Giter VIP home page Giter VIP logo

courses's People

Contributors

rcmadden avatar

Watchers

 avatar

courses's Issues

Potential License Violation: ChatGPT-Generated Code and GPL-3.0 Cloned code in OOP_exercise.py

Description:

Hi ,I found a potential issue regarding license violation in the OOP_exercise.py . The SalesPerson Class generated by ChatGPT may have been derived from another repository, leading to a violation of its license terms. Below are the details:

Details

The code OOP_exercise.py appears to have been generated by ChatGPT with The SalesPerson Class was generated by ChatGPT comments.

However, the code from lines 78 to 165 seems to be a code clone with D-Bhatta/Udacity-AWS-ML-Foundations repository and exercise.py file. The main difference between the two code snippets is the variable name and values. Additionally, the ChatGPT generated code was updated on Jan/30/2024 and the cloned code was updated on Jul/14/2020.

class SalesPerson:
### TODO: write an __init__ function to initialize the attributes
### Input Args for the __init__ function:
# first_name (str)
# last_name (str)
# employee_id (int)
# . salary (float)
#
# You can initialize pants_sold as an empty list
# You can initialize total_sales to zero.
#
###
def __init__(self, first_name, last_name, employee_id, salary):
self.first_name = str(first_name)
self.last_name = str(last_name)
self.employee_id = int(employee_id)
self.salary = float(salary)
self.pants_sold = []
self.total_sales = 0.0
### TODO: write a sell_pants method:
#
# This method receives a Pants object and appends
# the object to the pants_sold attribute list
#
# Args:
# pants (Pants object): a pants object
# Returns:
# None
def sell_pants(self, pants):
self.pants_sold.append(pants)
# return self.pants_sold
### TODO: write a display_sales method:
#
# This method has no input or outputs. When this method
# is called, the code iterates through the pants_sold list
# and prints out the characteristics of each pair of pants
# line by line. The print out should look something like this
#
# color: blue, waist_size: 34, length: 34, price: 10
# color: red, waist_size: 36, length: 30, price: 14.15
#
#
#
###
def display_sales(self):
for pants in self.pants_sold:
print('color: ', pants.color, 'waist_size: ', pants.waist_size, 'length: ', pants.length, 'price: ', pants.price)
### TODO: write a calculate_sales method:
# This method calculates the total sales for the sales person.
# The method should iterate through the pants_sold attribute list
# and sum the prices of the pants sold. The sum should be stored
# in the total_sales attribute and then return the total.
#
# Args:
# None
# Returns:
# float: total sales
#
###
def calculate_sales(self):
for pants in self.pants_sold:
self.total_sales += pants.price
return self.total_sales
### TODO: write a calculate_commission method:
#
# The salesperson receives a commission based on the total
# sales of pants. The method receives a percentage, and then
# calculate the total sales of pants based on the price,
# and then returns the commission as (percentage * total sales)
#
# Args:
# percentage (float): comission percentage as a decimal
#
# Returns:
# float: total commission
#
#
###
def calculate_commission(self, percentage):
self.percentage = percentage
return self.total_sales * self.percentage

There is no license for the ChatGPT-generated code in exercise.py and the repository. However, the cloned code is under GPL-3.0 license.
According to the conditions of this GPL-3.0 license :

You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice;

This means that if a developer uses GPL-3.0 protected code, they must include the same license. Since the ChatGPT-generated code has no license and the cloned code is under the GPL-3.0 license, there may be a potential license violation

  1. How do you view potential license conflicts between ChatGPT-generated code and existing open-source code?
  2. Is there a potential license conflict between the OOP_exercise.py and the exercise.py in D-Bhatta/Udacity-AWS-ML-Foundations ?
  3. If a license violation exists, should some explanation about open-source licenses be added at the file level or repository level?

Thank you for your attention to this matter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.