Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +16 -0
- 1577.jsonl +3 -0
- 1579.jsonl +3 -0
- 1580.jsonl +3 -0
- 1583.jsonl +3 -0
- 1584.jsonl +3 -0
- 1586.jsonl +3 -0
- 1589.jsonl +3 -0
- 1592.jsonl +3 -0
- 1593.jsonl +3 -0
- 1594.jsonl +3 -0
- 1595.jsonl +3 -0
- 1597.jsonl +3 -0
- 1598.jsonl +3 -0
- 1599.jsonl +3 -0
- 160.jsonl +3 -0
- 1601.jsonl +3 -0
- 4326.jsonl +0 -0
- 4328.jsonl +0 -0
- 4329.jsonl +0 -0
- 433.jsonl +0 -0
- 4337.jsonl +0 -0
- 4338.jsonl +0 -0
- 4343.jsonl +0 -0
- 4348.jsonl +8 -0
- 4356.jsonl +0 -0
- 4358.jsonl +0 -0
- 436.jsonl +0 -0
- 4368.jsonl +0 -0
- 4369.jsonl +0 -0
- 437.jsonl +0 -0
- 4370.jsonl +0 -0
- 4374.jsonl +0 -0
- 4375.jsonl +0 -0
- 438.jsonl +0 -0
- 4380.jsonl +0 -0
- 4381.jsonl +0 -0
- 4384.jsonl +0 -0
- 4389.jsonl +0 -0
- 4390.jsonl +0 -0
- 4391.jsonl +0 -0
- 4399.jsonl +0 -0
- 4406.jsonl +0 -0
- 4408.jsonl +0 -0
- 4410.jsonl +0 -0
- 4411.jsonl +0 -0
- 4413.jsonl +0 -0
- 4414.jsonl +0 -0
- 4417.jsonl +0 -0
- 4420.jsonl +0 -0
.gitattributes
CHANGED
|
@@ -508,3 +508,19 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 508 |
158.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 509 |
1585.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 510 |
1588.jsonl filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 508 |
158.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 509 |
1585.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 510 |
1588.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 511 |
+
1580.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 512 |
+
1586.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 513 |
+
1583.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 514 |
+
1599.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 515 |
+
1592.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 516 |
+
1594.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 517 |
+
1584.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 518 |
+
1577.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 519 |
+
1589.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 520 |
+
1593.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 521 |
+
1579.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 522 |
+
1595.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 523 |
+
1598.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 524 |
+
1601.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 525 |
+
160.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 526 |
+
1597.jsonl filter=lfs diff=lfs merge=lfs -text
|
1577.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1cb39a15ddadba424fa8bf6c65b903d97a2b4d5f78d8f3505cd925e0e81a5b80
|
| 3 |
+
size 62083404
|
1579.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:94ddc8ab6752a3a5d6236bfba40fbe11e95454b11b278dc2772ac37c64232ca8
|
| 3 |
+
size 63172707
|
1580.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3adf78ea68ac32c009b61900f322153b6fe12261f4a311fca4a2b72c0df219eb
|
| 3 |
+
size 59780366
|
1583.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2270f26d936719a40af3b8f5ef1f0ebe9e6375bd914a965d5530e53d1b89560c
|
| 3 |
+
size 57520159
|
1584.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a63a9e2afaf69636f3a918ecb62adc2ca236aad0ce9ac9d9ad0b8a055e81fa7b
|
| 3 |
+
size 52719306
|
1586.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c10083b684fd4a19ff521a8b1dc0e9e7a7b80c5af147db1431b0df37a84b36f2
|
| 3 |
+
size 75354772
|
1589.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44adba5f38967ba471fb83a886803f4d503c02b03a113ba221f6db1f24c4d5f9
|
| 3 |
+
size 53936998
|
1592.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c04b5fc5ea63202ca73a65a331b9567be4e442138d745103eb398c4bd51fd3d0
|
| 3 |
+
size 54317044
|
1593.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8fc394a218c02e251beac063c62b798d51a899005f4ede0962d8235448a65791
|
| 3 |
+
size 74246604
|
1594.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a6fc7bd8476be9bab2564f8bdd6a02ab18599c8694ad5f75a5b6a5c05a58095
|
| 3 |
+
size 59843661
|
1595.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06bd005f77ab46cb29a7ff947a6e0ed268c1529e81274b0ca8816cd4acedad6e
|
| 3 |
+
size 55138526
|
1597.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76b26a85d44488fa877903a97a6776d2e603c670311cf0d5a94cfeabc9af05b0
|
| 3 |
+
size 65347934
|
1598.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06c97942bb0c61244646ef2d23f5a9249f887acb8e657b6ca727ccd77d4443d8
|
| 3 |
+
size 52259120
|
1599.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ab0f35f7fc30f4bafcdfc75fa74b23525450f0402ce7e7fc7fd5abc0b7b955d
|
| 3 |
+
size 19885721
|
160.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d94873d7099b14455555cd44dd4e4025fd04855fe0f627b4999517c59b2341c1
|
| 3 |
+
size 59000565
|
1601.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be60966c1c41e397848c83f3b14058e34c39c3b5eaf4da5c317712856199ca28
|
| 3 |
+
size 64501362
|
4326.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4328.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4329.jsonl
ADDED
|
File without changes
|
433.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4337.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4338.jsonl
ADDED
|
File without changes
|
4343.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4348.jsonl
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"seq_id":"86680202","text":"import unittest\r\nimport numpy as np\r\nfrom MatrixTools.PreparePredictors import PreparePredictors\r\nfrom wheel.signatures import assertTrue\r\n\r\n\r\nclass Test(unittest.TestCase):\r\n\r\n\r\n def testPreparePredictors(self):\r\n '''Prepare some fake data. 3 stocks. One with net 10% growth, 20% and 30%'''\r\n outOfSampleStockReturns = np.array([[0, 0, -0.5, 1, 0.1],[0, 3, 0, -0.75, 0.2],[-0.5, 0, 0, 1, 0.3]])\r\n P = PreparePredictors(outOfSampleStockReturns)\r\n print('Minimum Variance Predictor is', P.getMinVarPredictor())\r\n print('Omniscient Predictor is', P.getOmniscientPredictor())\r\n K = P.getRandomPredictor()\r\n print('Random Predictor is', K)\r\n \r\n tol = 0.00000001\r\n '''Check the 2-norm of all vectors is sqrt(3)'''\r\n assertTrue(abs(np.linalg.norm(K)*np.linalg.norm(K)-3)<tol)\r\n assertTrue(abs(np.linalg.norm(P.getOmniscientPredictor())*np.linalg.norm(P.getOmniscientPredictor())-3)<tol)\r\n assertTrue(abs(np.linalg.norm(P.getMinVarPredictor())*np.linalg.norm(P.getMinVarPredictor())-3)<tol)\r\n\r\nif __name__ == \"__main__\":\r\n #import sys;sys.argv = ['', 'Test.testName']\r\n unittest.main()","sub_path":"MatrixTools/Test_PreparePredictors.py","file_name":"Test_PreparePredictors.py","file_ext":"py","file_size_in_byte":1178,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 2 |
+
{"seq_id":"68732882","text":"from django.db import models, IntegrityError\nfrom appmanager.core.models import User, BaseTimeStampModel\nfrom appmanager.administrative.models import Province,City,Villages,District\nimport base64\nimport os\nfrom django.urls import reverse\n\ndef generate_id():\n r_id = base64.b64encode(os.urandom(6)).decode('ascii')\n r_id = r_id.replace(\n '/', '').replace('_', '').replace('+', '').strip()\n return r_id\n\nclass Restaurant(BaseTimeStampModel):\n owner = models.OneToOneField(User, on_delete=models.CASCADE, related_name='owned_restaurant')\n name = models.CharField(max_length=300)\n phone_resto = models.CharField(max_length=12)\n description = models.TextField(null=True, blank=True)\n resto_province = models.ForeignKey(Province, on_delete=models.CASCADE, related_name='resto_in_province')\n resto_city = models.ForeignKey(City, on_delete=models.CASCADE, related_name='resto_in_city')\n resto_district = models.ForeignKey(District, on_delete=models.CASCADE, related_name='resto_in_district')\n resto_village = models.ForeignKey(Villages, on_delete=models.CASCADE, related_name='resto_in_village')\n resto_street_address = models.CharField(max_length=300)\n resto_zip_code = models.CharField(max_length=25)\n\n def save(self, *args, **kwargs):\n if not self.id:\n self.id = generate_id()\n success = False\n failures = 0\n while not success:\n try:\n super(Restaurant, self).save(*args, **kwargs)\n except IntegrityError:\n failures += 1\n if failures > 5: # or some other arbitrary cutoff point at which things are clearly wrong\n raise KeyError\n else:\n # looks like a collision, try another random value\n self.id = generate_id()\n else:\n success = True\n else:\n super(Restaurant, self).save(*args, **kwargs)\n\n\nclass Table(BaseTimeStampModel):\n uid = models.CharField(max_length=20,primary_key=True)\n resto = models.ForeignKey(Restaurant, on_delete=models.CASCADE, related_name='resto_tables')\n no_table = models.PositiveIntegerField()\n is_used = models.BooleanField(default=False)\n is_approved = models.BooleanField(default=False)\n \n \n \n def get_absolute_url(self):\n url_slug = {'uid':self.uid,'restoid':self.resto.id}\n return reverse(\"appmanager.resto:resto_url\", kwargs=url_slug)\n \n \n \n def save(self, *args, **kwargs):\n if not self.uid:\n self.uid = generate_id()\n success = False\n failures = 0\n while not success:\n try:\n super(Table, self).save(*args, **kwargs)\n except IntegrityError:\n failures += 1\n if failures > 5: # or some other arbitrary cutoff point at which things are clearly wrong\n raise KeyError\n else:\n # looks like a collision, try another random value\n self.uid = generate_id()\n else:\n success = True\n else:\n super(Table, self).save(*args, **kwargs)\n \n\n\nclass ObserverModels(models.Model):\n name = models.CharField(max_length=255,null=True,blank=True)\n other_attribute = models.CharField(max_length=255,null=True,blank=True)\n \n \n def __str__(self):\n return self.name","sub_path":"appmanager/resto/models.py","file_name":"models.py","file_ext":"py","file_size_in_byte":3552,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 3 |
+
{"seq_id":"73294822","text":"import pandas as pd\nimport numpy as np\nfrom pybrain.tools.customxml import NetworkReader\n\nname = 'InputData'\ndata = pd.read_csv(name)\n\ncolumns = list(data)\ninp = data[columns[0:]].values\n\nnet = NetworkReader.readFrom('Fas.xml')\ny_pred = net.activate(inp)\nprint(y_pred)","sub_path":"ModelActivate.py","file_name":"ModelActivate.py","file_ext":"py","file_size_in_byte":268,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 4 |
+
{"seq_id":"408458798","text":"from collections import OrderedDict\nfrom itertools import chain\n\nfrom django.db.models import Q\nfrom django.forms import CheckboxSelectMultiple\nfrom django.utils.translation import pgettext_lazy\nfrom django_filters import MultipleChoiceFilter, OrderingFilter, RangeFilter\n\nfrom ..core.filters import SortedFilterSet\nfrom .models import Attribute, Product\n\nSORT_BY_FIELDS = OrderedDict(\n [\n (\"name\", pgettext_lazy(\"Product list sorting option\", \"name\")),\n (\n \"minimal_variant_price_amount\",\n pgettext_lazy(\"Product list sorting option\", \"price\"),\n ),\n (\"updated_at\", pgettext_lazy(\"Product list sorting option\", \"last updated\")),\n ]\n)\n\n\nclass JSONBArrayFilter(MultipleChoiceFilter):\n def get_filter_predicate(self, v):\n operator = f\"{self.field_name}__has_key\"\n try:\n return {operator: getattr(v, self.field.to_field_name)}\n except (AttributeError, TypeError):\n return {operator: v}\n\n\nclass ProductFilter(SortedFilterSet):\n sort_by = OrderingFilter(\n label=pgettext_lazy(\"Product list sorting form\", \"Sort by\"),\n fields=SORT_BY_FIELDS.keys(),\n field_labels=SORT_BY_FIELDS,\n )\n minimal_variant_price = RangeFilter(\n label=pgettext_lazy(\"Currency amount\", \"Price\"),\n field_name=\"minimal_variant_price_amount\",\n )\n\n class Meta:\n model = Product\n fields = []\n\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n attributes = self._get_attributes()\n filters = {}\n for attribute in attributes:\n filters[attribute.slug] = JSONBArrayFilter(\n field_name=f\"attributes__from_key_{attribute.pk}\",\n label=attribute.translated.name,\n widget=CheckboxSelectMultiple,\n choices=self._get_attribute_choices(attribute),\n )\n self.filters.update(filters)\n\n def _get_attributes(self):\n q_product_attributes = self._get_product_attributes_lookup()\n q_variant_attributes = self._get_variant_attributes_lookup()\n product_attributes = (\n Attribute.objects.prefetch_related(\"translations\", \"values__translations\")\n .exclude(filterable_in_storefront=False)\n .filter(q_product_attributes)\n .distinct()\n )\n variant_attributes = (\n Attribute.objects.prefetch_related(\"translations\", \"values__translations\")\n .exclude(filterable_in_storefront=False)\n .filter(q_variant_attributes)\n .distinct()\n )\n\n attributes = chain(product_attributes, variant_attributes)\n attributes = sorted(\n attributes, key=lambda attr: attr.storefront_search_position\n )\n return attributes\n\n def _get_product_attributes_lookup(self):\n raise NotImplementedError()\n\n def _get_variant_attributes_lookup(self):\n raise NotImplementedError()\n\n def _get_attribute_choices(self, attribute):\n return [\n (choice.pk, choice.translated.name) for choice in attribute.values.all()\n ]\n\n\nclass ProductCategoryFilter(ProductFilter):\n def __init__(self, *args, **kwargs):\n self.category = kwargs.pop(\"category\")\n super().__init__(*args, **kwargs)\n\n def _get_product_attributes_lookup(self):\n categories = self.category.get_descendants(include_self=True)\n return Q(product_types__products__category__in=categories)\n\n def _get_variant_attributes_lookup(self):\n categories = self.category.get_descendants(include_self=True)\n return Q(product_variant_types__products__category__in=categories)\n\n\nclass ProductCollectionFilter(ProductFilter):\n def __init__(self, *args, **kwargs):\n self.collection = kwargs.pop(\"collection\")\n super().__init__(*args, **kwargs)\n\n def _get_product_attributes_lookup(self):\n return Q(product_types__products__collections=self.collection)\n\n def _get_variant_attributes_lookup(self):\n return Q(product_variant_types__products__collections=self.collection)\n","sub_path":"saleor/product/filters.py","file_name":"filters.py","file_ext":"py","file_size_in_byte":4116,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 5 |
+
{"seq_id":"348678311","text":"import discord\nfrom discord.ext import commands\n\n\nclass roles_cog:\n def __init__(self, bot):\n self.bot = bot\n self.console_roles = [\n \"Odyssey\",\n \"Ping-O-Tronic\",\n \"Pong\",\n \"PC-50X\",\n \"Tele-Spiel\",\n \"Video 2000\",\n \"Telestar\",\n \"Color TV-Game\",\n \"Champion 2711\",\n \"Fairchild Channel F\",\n \"RCA Studio II\",\n \"Bally Astrocade\",\n \"APF-MP1000\",\n \"VC 4000\",\n \"Odyssey 2\",\n \"Imagination Machine\",\n \"Super Vision 8000\",\n \"Intellivision\",\n \"PlayCable\",\n \"CreatiVision\",\n \"Casette Vision\",\n \"Leisure Vision\",\n \"ColecoVision\",\n \"Vectrex\",\n \"Master System\",\n \"Mega Drive\",\n \"Genesis\",\n \"Saturn\",\n \"Sega CD\",\n \"Dreamcast\",\n \"Game Gear\",\n \"Nomad\",\n \"2600\",\n \"5200\",\n \"7800\",\n \"Jaguar\",\n \"Playstation\",\n \"Playstation 2\",\n \"Playstation 3\",\n \"Playstation 4\",\n \"PSP\",\n \"Vita\",\n \"Nintendo Entertainment System\",\n \"Super Nintendo\",\n \"Nintendo 64\",\n \"Gamecube\",\n \"Wii\",\n \"Wii-U\",\n \"Switch\",\n \"Game Boy\",\n \"Game Boy Color\",\n \"Game Boy Advance\",\n \"Game Boy Pocket\",\n \"Game Boy Advance SP\",\n \"Virtual Boy\",\n \"DS\",\n \"DSi\",\n \"DSi XL\",\n \"DS Lite\",\n \"3DS\",\n \"3DS XL\",\n \"2DS\",\n \"New 3DS\",\n \"New 3DS XL\",\n \"New 2DS XL\",\n \"Xbox\",\n \"Xbox 360\",\n \"Xbox One\",\n \"PC\",\n \"Macintosh\",\n \"Apple II\",\n \"C64\",\n \"Amiga\",\n \"Tamagotchi\",\n \"Digimon\",\n \"VMU\",\n \"Tiger Handheld\",\n ]\n\n self.color_roles = [\n \"DPurple\",\n \"Purple\",\n \"DRed\",\n \"Red\",\n \"DOrange\",\n \"Orange\",\n \"DYellow\",\n \"Yellow\",\n \"DGreen\",\n \"Green\",\n \"DBlue\",\n \"Blue\",\n \"DGrey\",\n \"Grey\",\n \"Pink!\",\n ]\n\n def role_check(self, ctx, role_query):\n # returns True or False if a user has named role\n user = ctx.message.author\n for role in user.roles:\n if role.name == role_query:\n return True\n return False\n\n @commands.command()\n async def role(self, ctx, *, role_arg):\n user = ctx.message.author\n # let users use incorrect case for role names\n role_arg = role_arg.lower()\n consoles = [val.lower() for val in self.console_roles]\n colors = [val.lower() for val in self.color_roles]\n\n if role_arg in consoles:\n # fix lowercase in user input\n\n role_arg_formatted = self.console_roles[consoles.index(role_arg)]\n role = discord.utils.get(ctx.guild.roles, name=role_arg_formatted)\n\n # decide to add or remove\n if self.role_check(ctx, role_arg_formatted):\n await user.remove_roles(role)\n desc = \"%s left `%s`\" % (user.nick, role_arg_formatted)\n embed = discord.Embed(description=desc, color=0xeee657)\n\n else:\n await user.add_roles(role)\n desc = \"%s joined `%s`\" % (user.nick, role_arg_formatted)\n embed = discord.Embed(description=desc, color=0x58ee5f)\n\n elif role_arg in colors:\n # fix lowercase\n role_arg_formatted = self.color_roles[colors.index(role_arg)]\n role = discord.utils.get(ctx.guild.roles, name=role_arg_formatted)\n\n # remove from any other color before adding\n for possible_color in self.color_roles:\n if self.role_check(ctx, possible_color):\n await user.remove_roles(\n discord.utils.get(ctx.guild.roles, name=possible_color)\n )\n old_color = possible_color\n\n # add new color role\n await user.add_roles(role)\n desc = \"%s changed colors from `%s` to `%s`\" % (\n user.nick,\n old_color,\n role_arg_formatted,\n )\n embed = discord.Embed(description=desc, color=0x5235e3)\n\n else:\n # role not found\n\n desc = \"`%s` not found! Please refer to #info channel\" % (role_arg)\n embed = discord.Embed(description=desc, color=0xd1151e)\n\n await ctx.send(embed=embed)\n\n\ndef setup(bot):\n bot.add_cog(roles_cog(bot))\n","sub_path":"bot_commands/roles.py","file_name":"roles.py","file_ext":"py","file_size_in_byte":4924,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 6 |
+
{"seq_id":"23765874","text":"\n\n\ndef ask_user():\n ans_dict = {'Как дела?': 'Хорошо', 'Что делаешь?': 'Программирую'}\n while True:\n try:\n ans = input('Пользователь:')\n print(f'Программа: {ans_dict.get(ans, \"Я не могу тебе помочь.\")}')\n except KeyboardInterrupt:\n print('Пока')\n break\n\n\nask_user()\n","sub_path":"while_1.py","file_name":"while_1.py","file_ext":"py","file_size_in_byte":407,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 7 |
+
{"seq_id":"633596991","text":"\"\"\"Admin functions for a running pymap server.\"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport sys\nfrom argparse import ArgumentParser, Namespace, FileType\nfrom typing import Type, Mapping\n\nfrom grpclib.client import Channel # type: ignore\nfrom pkg_resources import iter_entry_points, DistributionNotFound\nfrom pymap import __version__\n\nfrom .command import ClientCommand\nfrom .. import AdminService\nfrom ..grpc.admin_grpc import AdminStub\n\n\ndef main() -> int:\n parser = ArgumentParser(description=__doc__)\n parser.add_argument('--version', action='version',\n version='%(prog)s' + __version__)\n parser.add_argument('--outfile', metavar='PATH',\n type=FileType('w'), default=sys.stdout,\n help='the output file (default: stdout)')\n parser.add_argument('--socket', metavar='PATH', help='path to socket file')\n\n subparsers = parser.add_subparsers(dest='command',\n help='which admin command to run')\n commands = _load_entry_points('pymap.admin.client')\n for command_name, command_cls in commands.items():\n command_cls.add_subparser(command_name, subparsers)\n args = parser.parse_args()\n\n if not args.command:\n parser.error('Expected command name.')\n command = commands[args.command]\n\n return asyncio.run(run(parser, args, command), debug=False)\n\n\nasync def run(parser: ArgumentParser, args: Namespace,\n command_cls: Type[ClientCommand]) -> int:\n loop = asyncio.get_event_loop()\n path = args.socket or AdminService.get_socket_path()\n channel = Channel(path=path, loop=loop)\n stub = AdminStub(channel)\n command = command_cls(stub, args)\n try:\n code = await command.run(args.outfile)\n finally:\n channel.close()\n return code\n\n\ndef _load_entry_points(group: str) -> Mapping[str, Type[ClientCommand]]:\n ret = {}\n for entry_point in iter_entry_points(group):\n try:\n cls = entry_point.load()\n except DistributionNotFound:\n pass # optional dependencies not installed\n else:\n ret[entry_point.name] = cls\n return ret\n","sub_path":"venv/Lib/site-packages/pymap/admin/client/main.py","file_name":"main.py","file_ext":"py","file_size_in_byte":2184,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
| 8 |
+
{"seq_id":"419435143","text":"#!/usr/bin/env python\nimport rospy\nimport math\nimport time\n\nfrom bowser_msg.msg import CommandVector\nfrom geometry_msgs.msg import Twist\n\nmotor_pub = rospy.Publisher('/bowser/diff_drive', Twist, queue_size=100)\n\n# def HeadingToXY(data):\n\n# \theading = data.steer\n# \theading = (heading - 1) * (math.pi/2)\n\n# \tthrottle = data.throttle\n\n# \ttwist = Twist()\n# \ttwist.linear.x = (math.cos(heading)) * throttle\n# \ttwist.linear.y = (math.sin(heading)) * throttle\n# \ttwist.linear.z = 0\n\n# \ttwist.angular.x = 0\n# \ttwist.angular.y = 0\n# \ttwist.angular.z = 0\n\n# \tmotor_pub.publish(twist)\n\ndef HeadingToXY(data):\n\n\t# heading = (data.steer - 1) * (math.pi/2)\n\t\n\ttwist = Twist()\n\ttwist.linear.x = data.throttle\n\ttwist.linear.y = 0\n\ttwist.linear.z = 0\n\n\ttwist.angular.x = 0\n\ttwist.angular.y = 0\n\ttwist.angular.z = data.steer\n\n\tmotor_pub.publish(twist)\t\n\ndef main():\n\n\trospy.init_node('motor_conversion', anonymous=True)\n\trospy.Subscriber('/bowser/motors', CommandVector, HeadingToXY)\n\trospy.spin()\n\nif __name__=='__main__':\n\tmain()","sub_path":"catkin_ws/src/bowser_sim/src/motor_conversion.py","file_name":"motor_conversion.py","file_ext":"py","file_size_in_byte":1014,"program_lang":"python","lang":"en","doc_type":"code","dataset":"code-starcoder2","pt":"16"}
|
4356.jsonl
ADDED
|
File without changes
|
4358.jsonl
ADDED
|
File without changes
|
436.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4368.jsonl
ADDED
|
File without changes
|
4369.jsonl
ADDED
|
File without changes
|
437.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4370.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4374.jsonl
ADDED
|
File without changes
|
4375.jsonl
ADDED
|
File without changes
|
438.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4380.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4381.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4384.jsonl
ADDED
|
File without changes
|
4389.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4390.jsonl
ADDED
|
File without changes
|
4391.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4399.jsonl
ADDED
|
File without changes
|
4406.jsonl
ADDED
|
File without changes
|
4408.jsonl
ADDED
|
File without changes
|
4410.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4411.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4413.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4414.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4417.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
4420.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|