hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1b8cbbb9911756c0be8813675035cd093be12a | 64 | py | Python | knx_stack/decode/knxnet_ip/core/connectionstate/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 2 | 2021-07-28T07:42:28.000Z | 2022-01-25T18:56:05.000Z | knx_stack/decode/knxnet_ip/core/connectionstate/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | 6 | 2021-07-25T21:36:01.000Z | 2022-02-20T21:11:31.000Z | knx_stack/decode/knxnet_ip/core/connectionstate/__init__.py | majamassarini/knx-stack | 11a9baac6b7600649b5fbca43c93b200b23676b4 | [
"MIT"
] | null | null | null | from knx_stack.decode.knxnet_ip.core.connectionstate import res
| 32 | 63 | 0.875 | from knx_stack.decode.knxnet_ip.core.connectionstate import res
| true | true |
1c1b8dac8f6703399a2f21fa6336970652e7718d | 1,143 | py | Python | zinc/ns_check.py | PressLabs/zinc | 9e1dc852f31f9897e7759962cf0f3e6d42fbe637 | [
"Apache-2.0"
] | 29 | 2017-06-29T15:03:49.000Z | 2018-01-30T14:07:26.000Z | zinc/ns_check.py | presslabs/zinc | 94146e5203fc93ee0e8bb011a4db0ffcd4b0096e | [
"Apache-2.0"
] | 9 | 2019-01-11T09:07:17.000Z | 2022-02-03T12:50:21.000Z | zinc/ns_check.py | PressLabs/zinc | 9e1dc852f31f9897e7759962cf0f3e6d42fbe637 | [
"Apache-2.0"
] | 1 | 2020-08-09T18:17:25.000Z | 2020-08-09T18:17:25.000Z | import json
import time
from django.conf import settings
from dns.resolver import Resolver
from dns.exception import DNSException
class CouldNotResolve(Exception):
pass
def get_resolver():
resolver = Resolver()
resolver.nameservers = settings.ZINC_NS_CHECK_RESOLVERS
return resolver
def is_ns_pro... | 27.878049 | 82 | 0.708661 | import json
import time
from django.conf import settings
from dns.resolver import Resolver
from dns.exception import DNSException
class CouldNotResolve(Exception):
pass
def get_resolver():
resolver = Resolver()
resolver.nameservers = settings.ZINC_NS_CHECK_RESOLVERS
return resolver
def is_ns_pro... | true | true |
1c1b8e909c2cb43fe43e7eef9d4259154b2b6771 | 4,775 | py | Python | experiment_automator/oauth_client.py | mpolatcan/ml-notifier | 1f2a7edcbd3edb49b1dcf03e43f3863720b466ac | [
"Apache-2.0"
] | 1 | 2018-10-09T20:07:19.000Z | 2018-10-09T20:07:19.000Z | experiment_automator/oauth_client.py | mpolatcan/experiment-automator | 1f2a7edcbd3edb49b1dcf03e43f3863720b466ac | [
"Apache-2.0"
] | null | null | null | experiment_automator/oauth_client.py | mpolatcan/experiment-automator | 1f2a7edcbd3edb49b1dcf03e43f3863720b466ac | [
"Apache-2.0"
] | null | null | null | from requests_oauthlib import OAuth1Session
from experiment_automator.constants import OAuthConstants
from experiment_automator.exceptions import OAuthException
from experiment_automator.utils import DebugLogCat
from os.path import exists
class OAuthClient:
def __init__(self, debug, oauth_config):
self.de... | 54.885057 | 132 | 0.69822 | from requests_oauthlib import OAuth1Session
from experiment_automator.constants import OAuthConstants
from experiment_automator.exceptions import OAuthException
from experiment_automator.utils import DebugLogCat
from os.path import exists
class OAuthClient:
def __init__(self, debug, oauth_config):
self.de... | true | true |
1c1b8ee3eeda63a69de6f4838968f767fccc2994 | 1,585 | py | Python | src/crop.py | sunanth123/pypixelator | c1d569d435a90a7993e1ea5f30d28d00c0ee8ad6 | [
"MIT"
] | null | null | null | src/crop.py | sunanth123/pypixelator | c1d569d435a90a7993e1ea5f30d28d00c0ee8ad6 | [
"MIT"
] | 3 | 2019-08-09T14:44:55.000Z | 2019-08-13T21:19:18.000Z | src/crop.py | sunanth123/pypixelator | c1d569d435a90a7993e1ea5f30d28d00c0ee8ad6 | [
"MIT"
] | null | null | null | ## this function is responsible for croping an image with given dimensions
from PIL import Image
def crop(im,xStart,xEnd,yStart,yEnd):
## get the dimensions and pixels from the original image
size = im.size
pixels = im.load()
## if invalid crop dimensions given by user then return error message
##... | 28.818182 | 79 | 0.584858 | ze[1]:
print("Invalid crop dimensions given")
return im
crop_width = xEnd - xStart + 1
crop_height = yEnd - yStart + 1
wPixels = newImg.load()
mir_width = size[0] - 1
mir_height = 0
relativex = xStart
relativey = yStart
cropx = 0
cropy = 0
if x == relativ... | true | true |
1c1b90697fa12fb709d883a9dc4f334621f300c5 | 27,436 | py | Python | elastalert/alerts.py | ssandler/elastalert | 62cd0625717a4fbd1a5a4edb3874ccd67030687e | [
"Apache-2.0"
] | 17 | 2016-02-11T09:13:14.000Z | 2020-06-06T18:40:36.000Z | elastalert/alerts.py | DalavanCloud/elastalert | 62cd0625717a4fbd1a5a4edb3874ccd67030687e | [
"Apache-2.0"
] | null | null | null | elastalert/alerts.py | DalavanCloud/elastalert | 62cd0625717a4fbd1a5a4edb3874ccd67030687e | [
"Apache-2.0"
] | 7 | 2016-07-13T10:16:15.000Z | 2021-06-04T06:41:14.000Z | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import subprocess
from email.mime.text import MIMEText
from smtplib import SMTP
from smtplib import SMTP_SSL
from smtplib import SMTPAuthenticationError
from smtplib import SMTPException
from socket import error
import boto.sns as sns
import requests
i... | 40.706231 | 145 | 0.600452 |
import datetime
import json
import logging
import subprocess
from email.mime.text import MIMEText
from smtplib import SMTP
from smtplib import SMTP_SSL
from smtplib import SMTPAuthenticationError
from smtplib import SMTPException
from socket import error
import boto.sns as sns
import requests
import simplejson
from j... | true | true |
1c1b90fabdd98cfdf87235a0aaba3e98589676d7 | 6,750 | py | Python | test/client_test.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | test/client_test.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | test/client_test.py | usegalaxy-eu/pulsar | 4dcaf61cceded8f0a83801cf1e9847e62656809f | [
"Apache-2.0"
] | null | null | null | from collections import deque
import tempfile
import os
from six import text_type, binary_type
from pulsar.client.client import JobClient
from pulsar.client.manager import HttpPulsarInterface
from pulsar.client.transport import Urllib2Transport
from pulsar.client.decorators import retry, MAX_RETRY_COUNT
def test_wi... | 32.451923 | 136 | 0.670074 | from collections import deque
import tempfile
import os
from six import text_type, binary_type
from pulsar.client.client import JobClient
from pulsar.client.manager import HttpPulsarInterface
from pulsar.client.transport import Urllib2Transport
from pulsar.client.decorators import retry, MAX_RETRY_COUNT
def test_wi... | true | true |
1c1b91a882798f1ce02142c12cb5c055e88e99f6 | 3,693 | py | Python | python/sparktk/frame/ops/column_median.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-05-20T22:26:05.000Z | 2022-01-21T12:55:13.000Z | python/sparktk/frame/ops/column_median.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 70 | 2016-06-28T01:11:21.000Z | 2021-03-15T21:40:01.000Z | python/sparktk/frame/ops/column_median.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-04-21T22:25:22.000Z | 2020-10-06T09:23:43.000Z | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 33.27027 | 115 | 0.603304 |
def column_median(self, data_column, weights_column=None):
val = self._scala.columnMedian(data_column, self._tc.jutils.convert.to_scala_option(weights_column))
optional_val = self._tc.jutils.convert.from_scala_option(val)
if optional_val is None:
return None
else:
retur... | true | true |
1c1b91f577fb734b743aa6f00aaebe8d0727dab9 | 52,281 | py | Python | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 34.784431 | 79 | 0.561217 |
import json
import time
import uuid
from keystoneclient.common import cms
from oslo_config import cfg
import six
from testtools import matchers
from keystone.common import extension as keystone_extension
from keystone.tests.unit import ksfixtures
from keystone.tests.unit import rest
CONF = cfg.CONF
... | true | true |
1c1b92440790db0249abb81b3db7bac2f0287bb9 | 182 | py | Python | homework/week4/hw5.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | null | null | null | homework/week4/hw5.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | 1 | 2021-11-04T16:30:26.000Z | 2021-11-04T16:30:26.000Z | homework/week4/hw5.py | jamestiotio/DW2020 | a8c575f1afd34d66dce2798a11b2fa15d1214a43 | [
"MIT"
] | null | null | null | def diff(p):
result = {}
for order, coeff in p.items():
if order == 0:
pass
else:
result[order - 1] = order * coeff
return result | 20.222222 | 45 | 0.467033 | def diff(p):
result = {}
for order, coeff in p.items():
if order == 0:
pass
else:
result[order - 1] = order * coeff
return result | true | true |
1c1b9321786acc35d723f03d9e1594cd604d9c98 | 14,974 | py | Python | Google/benchmarks/bert/implementations/bert-cloud-TF2.0-tpu-v3-32/tf2_common/benchmark/bert_benchmark.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | Google/benchmarks/bert/implementations/bert-cloud-TF2.0-tpu-v3-32/tf2_common/benchmark/bert_benchmark.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 9 | 2021-04-02T02:28:07.000Z | 2022-03-26T18:23:59.000Z | Google/benchmarks/bert/implementations/bert-cloud-TF2.0-tpu-v3-32/tf2_common/benchmark/bert_benchmark.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.394872 | 142 | 0.72666 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import json
import math
import os
import time
import REDACTED
from absl import flags
from absl.testing import flagsaver
import tensorflow.compat.v2 as tf
from REDACTED.tf2_co... | true | true |
1c1b93f79900e22292cc3b8457bf5c372c972eea | 5,105 | py | Python | src/load_db.py | ifly6/NS-WA-Authorboards | 57921457795306867844a29cdfce88bfcdd1c3f6 | [
"Apache-2.0"
] | null | null | null | src/load_db.py | ifly6/NS-WA-Authorboards | 57921457795306867844a29cdfce88bfcdd1c3f6 | [
"Apache-2.0"
] | null | null | null | src/load_db.py | ifly6/NS-WA-Authorboards | 57921457795306867844a29cdfce88bfcdd1c3f6 | [
"Apache-2.0"
] | 1 | 2020-12-14T02:16:00.000Z | 2020-12-14T02:16:00.000Z | # Copyright (c) 2017 Auralia
# Modifications, copyright (c) 2020 ifly6
import csv
from datetime import datetime
def is_same_name(i, a):
return i.lower().strip() == a.lower().strip()
class Database:
def __init__(self):
self.resolutions = []
self.authors = []
self.player_authors = []
... | 34.965753 | 111 | 0.546915 |
import csv
from datetime import datetime
def is_same_name(i, a):
return i.lower().strip() == a.lower().strip()
class Database:
def __init__(self):
self.resolutions = []
self.authors = []
self.player_authors = []
self.aliases = {}
@staticmethod
def create(resolution... | true | true |
1c1b9480e364b0d9844e82350579e82a39b689e0 | 1,178 | py | Python | ship/alient_invasion.py | 1665695549/phython-alien | 3ab3fcfef85a6b145a3be0d203c942b2bc497d1c | [
"Apache-2.0"
] | null | null | null | ship/alient_invasion.py | 1665695549/phython-alien | 3ab3fcfef85a6b145a3be0d203c942b2bc497d1c | [
"Apache-2.0"
] | null | null | null | ship/alient_invasion.py | 1665695549/phython-alien | 3ab3fcfef85a6b145a3be0d203c942b2bc497d1c | [
"Apache-2.0"
] | null | null | null | import sys
import pygame
from settings import Settings
from ship import Ship
import game_functions as gf
from pygame.sprite import Group
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
def run_game():
#初始化游戏并创建一个屏幕对象
pygame.init()
ai_settings=Settings()
screen=pygame... | 25.608696 | 85 | 0.798812 | import sys
import pygame
from settings import Settings
from ship import Ship
import game_functions as gf
from pygame.sprite import Group
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
def run_game():
pygame.init()
ai_settings=Settings()
screen=pygame.display.set_mo... | true | true |
1c1b9489d6ca63a9a79af3522420f31f355e79e9 | 3,080 | py | Python | cognite/client/data_classes/model_hosting/schedules.py | pubuduSiti/cognite-sdk-python | d2020676c09b4db9fd4d0343756c836beb73e417 | [
"Apache-2.0"
] | 59 | 2018-03-07T10:35:29.000Z | 2022-03-25T13:11:47.000Z | cognite/client/data_classes/model_hosting/schedules.py | pubuduSiti/cognite-sdk-python | d2020676c09b4db9fd4d0343756c836beb73e417 | [
"Apache-2.0"
] | 768 | 2018-03-21T07:07:31.000Z | 2022-03-29T20:01:45.000Z | cognite/client/data_classes/model_hosting/schedules.py | pubuduSiti/cognite-sdk-python | d2020676c09b4db9fd4d0343756c836beb73e417 | [
"Apache-2.0"
] | 24 | 2018-08-31T19:37:57.000Z | 2021-09-23T13:28:55.000Z | from typing import *
from cognite.client.data_classes._base import CogniteResource, CogniteResourceList, CogniteResponse
class Schedule(CogniteResource):
"""A representation of a Schedule in the model hosting environment.
Args:
name (str): Name of the schedule.
model_name (str): The name of ... | 34.222222 | 105 | 0.661688 | from typing import *
from cognite.client.data_classes._base import CogniteResource, CogniteResourceList, CogniteResponse
class Schedule(CogniteResource):
def __init__(
self,
name: str = None,
model_name: str = None,
description: str = None,
data_spec: Union["ScheduleDataS... | true | true |
1c1b948c0ab7bcc6bf8d2e3a697fc7c2e6a5da88 | 449 | py | Python | covid_certificate_generator/_nbdev.py | trancept/covid_certificate_generator | ba59669e73944886cebb4db4aed8de604ff4086b | [
"Apache-2.0"
] | 1 | 2020-10-31T07:29:52.000Z | 2020-10-31T07:29:52.000Z | covid_certificate_generator/_nbdev.py | trancept/covid_certificate_generator | ba59669e73944886cebb4db4aed8de604ff4086b | [
"Apache-2.0"
] | 2 | 2021-09-28T05:41:25.000Z | 2022-02-26T10:09:42.000Z | covid_certificate_generator/_nbdev.py | trancept/covid_certificate_generator | ba59669e73944886cebb4db4aed8de604ff4086b | [
"Apache-2.0"
] | 2 | 2020-10-31T07:29:58.000Z | 2021-10-02T16:50:13.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"PDFGenerator": "pdf_generator.ipynb",
"PDF": "pdf_helper.ipynb"}
modules = ["pdf_generator.py",
"pdf_helper.py"]
doc_url = "https://dataforgoodfr.github.io/covid_certificate_generator/"... | 28.0625 | 85 | 0.717149 |
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"PDFGenerator": "pdf_generator.ipynb",
"PDF": "pdf_helper.ipynb"}
modules = ["pdf_generator.py",
"pdf_helper.py"]
doc_url = "https://dataforgoodfr.github.io/covid_certificate_generator/"
git_url = "https://github.com/datafo... | true | true |
1c1b94fa6bcfd2eeca9dd39f3a4ad0dfd338cd29 | 4,049 | py | Python | tfx/components/example_gen/custom_executors/parquet_executor_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | null | null | null | tfx/components/example_gen/custom_executors/parquet_executor_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | null | null | null | tfx/components/example_gen/custom_executors/parquet_executor_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 37.841121 | 80 | 0.673006 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import apache_beam as beam
from apache_beam.testing import util
import tensorflow as tf
from tfx.components.example_gen.custom_executors import parquet_executor
from tfx.proto import exa... | true | true |
1c1b952008eed86ec0d72b2e5e562e2386c50502 | 206 | py | Python | grand_contest/019/A.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | grand_contest/019/A.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | grand_contest/019/A.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
q, h, s, d = map(int, input().split())
n = int(input())
print((n // 2) * min(8 * q, 4 * h, 2 * s, d) + (n % 2) * min(4 * q, 2 * h, s))
| 22.888889 | 78 | 0.529126 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
q, h, s, d = map(int, input().split())
n = int(input())
print((n // 2) * min(8 * q, 4 * h, 2 * s, d) + (n % 2) * min(4 * q, 2 * h, s))
| true | true |
1c1b955403001e082226d5e93b798a9a63787d25 | 1,030 | py | Python | Aula17_Listas/desafio088.py | ElielLaynes/Curso_Python3_Mundo3_Fundamentos | f6d2bab3fc7496bbe8f223129c6b689d733e956a | [
"MIT"
] | null | null | null | Aula17_Listas/desafio088.py | ElielLaynes/Curso_Python3_Mundo3_Fundamentos | f6d2bab3fc7496bbe8f223129c6b689d733e956a | [
"MIT"
] | null | null | null | Aula17_Listas/desafio088.py | ElielLaynes/Curso_Python3_Mundo3_Fundamentos | f6d2bab3fc7496bbe8f223129c6b689d733e956a | [
"MIT"
] | null | null | null | '''
- Faça um programa que:
Ajude um jogador da mega sena a criar palpites
O programa vai:
1) Perguntar quantos jogos serão gerados
2) sortear 6 números entre 1 e 60 para cada jogo
3) cadastrando tudo em uma lista composta
'''
from time import sleep
from random import randint
cont... | 21.020408 | 73 | 0.585437 | from time import sleep
from random import randint
cont = 0
lista_jogos = []
jogos = []
print('-' * 40)
print(f'\n SORTEADOR DE NÚMEROS DA MEGA SENA \n')
print('-' * 40, '\n')
num_jogos = int ( input ( 'Quantos Jogos você quer Sortear? ' ) )
total = 1
while total <= num_jogos:
cont = 0
while True:
... | true | true |
1c1b9739b976495d5b9b5a5442c65279e1d19981 | 640 | py | Python | signs/vectorize/spacy.py | abhijithneilabraham/signs | 1ce8f6fe5468ec9a69d2d29646be3b3e400879d2 | [
"MIT"
] | 13 | 2018-06-22T21:30:28.000Z | 2022-01-26T20:58:24.000Z | signs/vectorize/spacy.py | abhijithneilabraham/signs | 1ce8f6fe5468ec9a69d2d29646be3b3e400879d2 | [
"MIT"
] | 13 | 2018-07-29T14:41:52.000Z | 2022-02-09T08:22:27.000Z | signs/vectorize/spacy.py | abhijithneilabraham/signs | 1ce8f6fe5468ec9a69d2d29646be3b3e400879d2 | [
"MIT"
] | 3 | 2018-08-06T06:42:39.000Z | 2022-02-10T14:53:02.000Z | import spacy as sp
def spacy_load(trained_vectors='en'):
'''LOAD SPACY MODEL
The default option 'en' loads the spacy default vectors.
Alternative a local vector file can be loaded or one of the
other spacy vectors.
'''
if trained_vectors == 'en':
import en_core_web_sm
retu... | 17.777778 | 63 | 0.6625 | import spacy as sp
def spacy_load(trained_vectors='en'):
if trained_vectors == 'en':
import en_core_web_sm
return en_core_web_sm.load()
else:
return sp.load(trained_vectors)
def spacy_word2vec(string, model):
return model(string).vector
| true | true |
1c1b97adeb7e85d95eec0832aeadb651751cbe27 | 2,541 | py | Python | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | # coding=utf8
import traceback
import json
import redis
from django.conf import settings
REDIS = settings.REDIS['proxy']
class RedisClient(object):
def __init__(self):
try:
if REDIS['password']:
redis_pool = redis.ConnectionPool(host=REDIS['host'], port=REDIS['port'], password... | 27.031915 | 133 | 0.590712 |
import traceback
import json
import redis
from django.conf import settings
REDIS = settings.REDIS['proxy']
class RedisClient(object):
def __init__(self):
try:
if REDIS['password']:
redis_pool = redis.ConnectionPool(host=REDIS['host'], port=REDIS['port'], password=REDIS['passw... | true | true |
1c1b9820bd5629018087da23502fa6b1871eac34 | 462 | py | Python | Week2/practices/practice4/Hanoi_list.py | syenpark/Intro2CSandPy | ad4dc98f84c1cb19f57298927cd7c12066d79bb0 | [
"MIT"
] | null | null | null | Week2/practices/practice4/Hanoi_list.py | syenpark/Intro2CSandPy | ad4dc98f84c1cb19f57298927cd7c12066d79bb0 | [
"MIT"
] | null | null | null | Week2/practices/practice4/Hanoi_list.py | syenpark/Intro2CSandPy | ad4dc98f84c1cb19f57298927cd7c12066d79bb0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
@author: syenpark
Python Version: 3.6
"""
A = [3, 2, 1]
B = []
C = []
def Towers(n, source, target, auxiliary):
if n > 0:
Towers(n-1, source, auxiliary, target)
target.append(source.pop())
progress(A, B, C)
Towers(n-1, auxiliary, t... | 17.769231 | 46 | 0.502165 |
A = [3, 2, 1]
B = []
C = []
def Towers(n, source, target, auxiliary):
if n > 0:
Towers(n-1, source, auxiliary, target)
target.append(source.pop())
progress(A, B, C)
Towers(n-1, auxiliary, target, source)
def progress(a, b, c):
print('A', a)
print('B',b)
print(... | true | true |
1c1b985edcaf71970681a37ffa2d67bcc8af1cd9 | 803 | py | Python | BBBY/start_merge_orders_job.py | anandj123/gcpdemo | 96ef4c64047b16f397369c71ace74daa7d43acec | [
"MIT"
] | null | null | null | BBBY/start_merge_orders_job.py | anandj123/gcpdemo | 96ef4c64047b16f397369c71ace74daa7d43acec | [
"MIT"
] | null | null | null | BBBY/start_merge_orders_job.py | anandj123/gcpdemo | 96ef4c64047b16f397369c71ace74daa7d43acec | [
"MIT"
] | null | null | null | """Call the stored procedure to populate orders operational layer table"""
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import timedelta
default_args = {
'start_date': airflow.utils.dates.days_ago(0),
'retries': 1,
'retry_delay': timedelta(mi... | 30.884615 | 113 | 0.744707 | import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import timedelta
default_args = {
'start_date': airflow.utils.dates.days_ago(0),
'retries': 1,
'retry_delay': timedelta(minutes=5)
}
dag = DAG(
'start_merge_orders_job',
default_args=defau... | true | true |
1c1b995cd34270e32233621421150b8f580a4547 | 4,051 | py | Python | money.py | htchr/dolla-dolla | b1b74975410138678bcf262e42ffe82d3939d2dc | [
"MIT"
] | null | null | null | money.py | htchr/dolla-dolla | b1b74975410138678bcf262e42ffe82d3939d2dc | [
"MIT"
] | null | null | null | money.py | htchr/dolla-dolla | b1b74975410138678bcf262e42ffe82d3939d2dc | [
"MIT"
] | null | null | null | #!/Users/jack/Documents/projects/22-dolla/venv/bin/python3
import sqlite3
import csv
import gspread
db = "/Users/jack/Documents/projects/22-dolla/money.db"
cat_path = "/Users/jack/Documents/projects/22-dolla/categories.csv"
def ask_for_int(message, max=1000000000):
"""
support function to ask users for an in... | 30.007407 | 85 | 0.490002 |
import sqlite3
import csv
import gspread
db = "/Users/jack/Documents/projects/22-dolla/money.db"
cat_path = "/Users/jack/Documents/projects/22-dolla/categories.csv"
def ask_for_int(message, max=1000000000):
while True:
i = input(message)
try:
i = int(i)
if i <= max:
... | true | true |
1c1b9a8fb11ef5c7bb309df0f97d042dca4dccb1 | 41,715 | py | Python | plugins/modules/zhmc_storage_group.py | zhmcclient/zhmc-ansible-modules | 95ee6363448e917906dc9c7925671eab0357542e | [
"Apache-2.0"
] | 10 | 2017-08-10T07:40:29.000Z | 2021-03-18T18:33:08.000Z | plugins/modules/zhmc_storage_group.py | zhmcclient/zhmc-ansible-modules | 95ee6363448e917906dc9c7925671eab0357542e | [
"Apache-2.0"
] | 439 | 2017-07-20T07:31:08.000Z | 2022-03-27T19:59:22.000Z | plugins/modules/zhmc_storage_group.py | zhmcclient/zhmc-ansible-modules | 95ee6363448e917906dc9c7925671eab0357542e | [
"Apache-2.0"
] | 9 | 2019-03-30T08:49:40.000Z | 2021-05-15T02:42:11.000Z | #!/usr/bin/python
# Copyright 2018-2020 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.095595 | 153 | 0.614767 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community',
'shipped_by': 'other',
'other_repo_url': 'https://github.com/zhmcclient/zhmc-ansible... | true | true |
1c1b9b2349985ee9e037695acc28dfe20d840e80 | 2,356 | py | Python | custom_components/saj_modbus/config_flow.py | fsaris/home-assistant-saj-modbus | cb64cbac0bf09d9f71d8f5261845de4f548b9d6a | [
"MIT"
] | 12 | 2021-03-05T08:32:48.000Z | 2022-01-10T21:17:30.000Z | custom_components/saj_modbus/config_flow.py | fsaris/home-assistant-saj-modbus | cb64cbac0bf09d9f71d8f5261845de4f548b9d6a | [
"MIT"
] | 12 | 2021-03-06T14:34:55.000Z | 2022-03-03T15:07:56.000Z | custom_components/saj_modbus/config_flow.py | fsaris/home-assistant-saj-modbus | cb64cbac0bf09d9f71d8f5261845de4f548b9d6a | [
"MIT"
] | 7 | 2021-03-05T11:12:17.000Z | 2021-08-11T16:52:39.000Z | import ipaddress
import re
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (CONF_HOST, CONF_NAME, CONF_PORT,
CONF_SCAN_INTERVAL)
from homeassistant.core import HomeAssistant, callback
from .const import DEFAULT_NAME, DEFAULT_PORT, DEFA... | 32.273973 | 84 | 0.654075 | import ipaddress
import re
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (CONF_HOST, CONF_NAME, CONF_PORT,
CONF_SCAN_INTERVAL)
from homeassistant.core import HomeAssistant, callback
from .const import DEFAULT_NAME, DEFAULT_PORT, DEFA... | true | true |
1c1b9be9f0a710ade956ff947792e85bb622b46c | 15,807 | py | Python | quantization/dataset.py | pulp-platform/kws-on-pulp | 3a1e60ef0b8781bd6db1279e465fc0799a789079 | [
"Apache-2.0"
] | null | null | null | quantization/dataset.py | pulp-platform/kws-on-pulp | 3a1e60ef0b8781bd6db1279e465fc0799a789079 | [
"Apache-2.0"
] | null | null | null | quantization/dataset.py | pulp-platform/kws-on-pulp | 3a1e60ef0b8781bd6db1279e465fc0799a789079 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.030641 | 233 | 0.6995 |
import hashlib
import math
import os.path
import random
import os
import re
import glob
import time
import torch
import torchaudio
from collections import Counter, OrderedDict
import soundfile as sf
import numpy as np
import tensorflow as tf
MAX_NUM_WAVS_PER_CLASS = 2**27 - 1
BACKGROUND_NOISE_L... | true | true |
1c1b9c5ad292fe8c619e1581d73dd64602ec5fa8 | 2,827 | py | Python | doc/cdoc/numpyfilter.py | bdvd/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | 1 | 2020-12-07T17:25:19.000Z | 2020-12-07T17:25:19.000Z | doc/cdoc/numpyfilter.py | sahanabalappa/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | null | null | null | doc/cdoc/numpyfilter.py | sahanabalappa/numpy | cea994fac86dbc5af7bee3f15fc5b475a99163fa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
numpyfilter.py [-h] inputfile
Interpret C comments as ReStructuredText, and replace them by the HTML output.
Also, add Doxygen /** and /**< syntax automatically where appropriate.
"""
import sys
import re
import os
import textwrap
from numpy.compat import pickle
CACHE_FILE = 'build/rst-cac... | 26.92381 | 78 | 0.558543 |
import sys
import re
import os
import textwrap
from numpy.compat import pickle
CACHE_FILE = 'build/rst-cache.pck'
def main():
import argparse
parser = argparse.ArgumentParser(usage=__doc__.strip())
parser.add_argument('input_file', help='input file')
args = parser.parse_args()
comment_re = re.... | true | true |
1c1b9c902042b29450bcad57567adebb8814e62c | 1,989 | py | Python | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_l_configuration_getter_separate_instances_and_exemplars.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | 1 | 2021-07-20T15:48:58.000Z | 2021-07-20T15:48:58.000Z | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_l_configuration_getter_separate_instances_and_exemplars.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | bclearer_boson_1_1_source/b_code/configurations/getters/boson_1_2e_l_configuration_getter_separate_instances_and_exemplars.py | boro-alpha/bclearer_boson_1_1 | 15207d240fd3144b155922dc5c5d14822023026a | [
"MIT"
] | null | null | null | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_instance_to_exemplar_configuration_object... | 53.756757 | 146 | 0.828054 | from bclearer_boson_1_1_source.b_code.common_knowledge.inspire_matched_ea_objects import InspireMatchedEaObjects
from bclearer_source.b_code.common_knowledge.convention_shift_operation_types import ConventionShiftOperationTypes
from bclearer_source.b_code.configurations.bespoke_instance_to_exemplar_configuration_object... | true | true |
1c1b9d4dc383a90134ace9d13782b334f3369b3d | 422 | py | Python | jorldy/config/reinforce/cartpole.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/config/reinforce/cartpole.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/config/reinforce/cartpole.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | ### REINFORCE CartPole Config ###
env = {
"name": "cartpole",
"action_type": "discrete",
"render": False,
}
agent = {
"name": "reinforce",
"network": "discrete_policy",
"gamma": 0.99,
}
optim = {
"name": "adam",
"lr": 1e-4,
}
train = {
"training": True,
"load_path": None,
... | 14.551724 | 33 | 0.535545 | "render": False,
}
agent = {
"name": "reinforce",
"network": "discrete_policy",
"gamma": 0.99,
}
optim = {
"name": "adam",
"lr": 1e-4,
}
train = {
"training": True,
"load_path": None,
"run_step": 100000,
"print_period": 1000,
"save_period": 10000,
"eval_iteration": 10,
}
| true | true |
1c1b9dc23ddcb9a321650d00dafce7fa0517baaf | 615 | py | Python | python-sdk/odi/dataset/__init__.py | Project-OpenBytes/odi | ab9dbcc4d29c80e21f1a8ca3be911eb755495c54 | [
"Apache-2.0"
] | 5 | 2021-12-09T09:32:36.000Z | 2022-01-31T20:21:35.000Z | python-sdk/odi/cli/__init__.py | Project-OpenBytes/odi | ab9dbcc4d29c80e21f1a8ca3be911eb755495c54 | [
"Apache-2.0"
] | 17 | 2022-01-07T04:24:25.000Z | 2022-02-14T11:22:41.000Z | python-sdk/odi/dataset/__init__.py | Project-OpenBytes/odi | ab9dbcc4d29c80e21f1a8ca3be911eb755495c54 | [
"Apache-2.0"
] | 6 | 2021-12-09T09:29:22.000Z | 2021-12-31T11:00:24.000Z | # Copyright 2021 The OpenBytes Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 43.928571 | 75 | 0.75122 | true | true | |
1c1b9f2d1e0c748c180b924fec3051592168df0e | 538 | py | Python | easyci/app/api/addTask.py | 9OMShitikov/anytask | 71354543f467f6c824dfb194bf48ee76c391ff53 | [
"MIT"
] | null | null | null | easyci/app/api/addTask.py | 9OMShitikov/anytask | 71354543f467f6c824dfb194bf48ee76c391ff53 | [
"MIT"
] | null | null | null | easyci/app/api/addTask.py | 9OMShitikov/anytask | 71354543f467f6c824dfb194bf48ee76c391ff53 | [
"MIT"
] | null | null | null | from app.api import bp
from flask import url_for, make_response, request
from app.easyCI.tasksPool import put_to_pool
from flask import current_app
from werkzeug.local import LocalProxy
logger = LocalProxy(lambda: current_app.logger)
@bp.route('/add_task', methods=['POST'])
def add_task():
logger.info(3)
dat... | 25.619048 | 58 | 0.732342 | from app.api import bp
from flask import url_for, make_response, request
from app.easyCI.tasksPool import put_to_pool
from flask import current_app
from werkzeug.local import LocalProxy
logger = LocalProxy(lambda: current_app.logger)
@bp.route('/add_task', methods=['POST'])
def add_task():
logger.info(3)
dat... | true | true |
1c1ba0fdb78fbd9c6cbd7e6e428d65d49cc16fe7 | 1,192 | py | Python | src/segmentation/ClusterTransformer.py | stefantaubert/imageclef-lifelog-2019 | e779526583978be828ebc096538d094cc3cc260e | [
"MIT"
] | 1 | 2020-08-15T01:55:07.000Z | 2020-08-15T01:55:07.000Z | src/segmentation/ClusterTransformer.py | stefantaubert/imageclef-lifelog-2019 | e779526583978be828ebc096538d094cc3cc260e | [
"MIT"
] | null | null | null | src/segmentation/ClusterTransformer.py | stefantaubert/imageclef-lifelog-2019 | e779526583978be828ebc096538d094cc3cc260e | [
"MIT"
] | null | null | null | from src.segmentation.CachableTransformerBase import CachableTransformerBase
import scipy.cluster.hierarchy as shc
class ClusterTransformer(CachableTransformerBase):
"""
Perform hierarchical (agglomerative) clustering to the given histograms.
Parameters:
- metric: the metric which is used for comparing... | 42.571429 | 129 | 0.692953 | from src.segmentation.CachableTransformerBase import CachableTransformerBase
import scipy.cluster.hierarchy as shc
class ClusterTransformer(CachableTransformerBase):
def __init__(self, day: int, usr: int, is_dirty: bool = False, metric='euclidean', method='average'):
self.metric = metric
self.metho... | true | true |
1c1ba2fbb38096db186d8008454288da4b8edbcf | 6,864 | py | Python | molmap/utils/matrixopt.py | SuperXiang/bidd-molmap | f0f5da299e4da4ebae83eed81ddfdad31c707d92 | [
"MIT"
] | 1 | 2021-04-01T05:06:16.000Z | 2021-04-01T05:06:16.000Z | molmap/utils/matrixopt.py | SuperXiang/bidd-molmap | f0f5da299e4da4ebae83eed81ddfdad31c707d92 | [
"MIT"
] | null | null | null | molmap/utils/matrixopt.py | SuperXiang/bidd-molmap | f0f5da299e4da4ebae83eed81ddfdad31c707d92 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 25 20:29:36 2019
@author: wanxiang.shen@u.nus.edu
matrix operation
"""
import numpy as np
from lapjv import lapjv
from scipy.signal import convolve2d
from scipy.spatial.distance import cdist
class Scatter2Grid:
def __init__(self):
... | 31.631336 | 83 | 0.526661 |
import numpy as np
from lapjv import lapjv
from scipy.signal import convolve2d
from scipy.spatial.distance import cdist
class Scatter2Grid:
def __init__(self):
self.fmap_shape = None
self.indices = None
self.indices_list = None
def fit(self, df, split_channels = Tru... | true | true |
1c1ba32d49bcf8c60d5bcfecd6415f4e070b2b7c | 3,657 | py | Python | mutatio/share/kivy-examples/widgets/focus_behavior.py | SmatMan/mutatio | e6e24c45054321f9cb753499f0842ee8c8969c56 | [
"MIT"
] | null | null | null | mutatio/share/kivy-examples/widgets/focus_behavior.py | SmatMan/mutatio | e6e24c45054321f9cb753499f0842ee8c8969c56 | [
"MIT"
] | null | null | null | mutatio/share/kivy-examples/widgets/focus_behavior.py | SmatMan/mutatio | e6e24c45054321f9cb753499f0842ee8c8969c56 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.behaviors import FocusBehavior
from kivy.graphics import Color, Rectangle
class FocusWithColor(FocusBehavior):
''' Class that when focused, changes i... | 36.939394 | 79 | 0.605414 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.behaviors import FocusBehavior
from kivy.graphics import Color, Rectangle
class FocusWithColor(FocusBehavior):
_color = None
_rect = None
... | true | true |
1c1ba404d76fe7d46a22a7a1a40604df105fc862 | 612 | py | Python | PreProcessing.py | sameesayeed007/DSE-MC-Portfolio-Optimization | 573f5f23b380efb07de7798e938d2ca51648e06c | [
"MIT"
] | 1 | 2021-05-11T22:29:37.000Z | 2021-05-11T22:29:37.000Z | PreProcessing.py | IngeniousArtist/DSE-MCPortfolioOptimization | 06a2cd331709134390fd27415a50a8d8cfc0e44d | [
"MIT"
] | null | null | null | PreProcessing.py | IngeniousArtist/DSE-MCPortfolioOptimization | 06a2cd331709134390fd27415a50a8d8cfc0e44d | [
"MIT"
] | null | null | null | #importing lib
import pandas as pd
#read csv
df = pd.read_csv("Data_2015_1.csv")
#selecting necessary column
df1 = df.iloc[:,1:4]
#renaming columns
df1.columns = ['Date','Tickers','Price']
#Dropping treasury bill rows
df1 = df1[~df1.Tickers.str.contains('|'.join(['T05Y','T10Y','T15Y','T20Y','T5Y']))]
#Converting Price ... | 38.25 | 85 | 0.712418 |
import pandas as pd
df = pd.read_csv("Data_2015_1.csv")
df1 = df.iloc[:,1:4]
df1.columns = ['Date','Tickers','Price']
df1 = df1[~df1.Tickers.str.contains('|'.join(['T05Y','T10Y','T15Y','T20Y','T5Y']))]
df1.Price = pd.to_numeric(df1.Price.astype(str).str.replace(',',''), errors='coerce')
df2= pd.pivot_table(df1, ... | true | true |
1c1ba437eeafb68909f78b055ae265c7ccc0c313 | 801 | py | Python | app/models/binance_account.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | null | null | null | app/models/binance_account.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | 8 | 2021-09-28T12:55:38.000Z | 2022-01-05T22:45:20.000Z | app/models/binance_account.py | germainlefebvre4/cryptobot-api | 6b8f10554bbb50ac669c8f8a87414c9292fc9d7b | [
"MIT"
] | null | null | null | from sqlalchemy import Boolean, Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from app.db.base_class import Base
class BinanceAccount(Base):
__tablename__ = "binance_accounts"
id = Column(Integer, primary_key=True, index=True)
binance_api_url = Column(String,... | 30.807692 | 77 | 0.725343 | from sqlalchemy import Boolean, Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from app.db.base_class import Base
class BinanceAccount(Base):
__tablename__ = "binance_accounts"
id = Column(Integer, primary_key=True, index=True)
binance_api_url = Column(String,... | true | true |
1c1ba43a29d3807feb16dbebdac9934ca8fffcc5 | 6,313 | py | Python | category_encoders/backward_difference.py | Guillermogsjc/categorical-encoding | 0310a64f6a48fcdbd41df8eea2bf11ddfafec78e | [
"BSD-3-Clause"
] | null | null | null | category_encoders/backward_difference.py | Guillermogsjc/categorical-encoding | 0310a64f6a48fcdbd41df8eea2bf11ddfafec78e | [
"BSD-3-Clause"
] | null | null | null | category_encoders/backward_difference.py | Guillermogsjc/categorical-encoding | 0310a64f6a48fcdbd41df8eea2bf11ddfafec78e | [
"BSD-3-Clause"
] | 1 | 2019-12-04T14:45:30.000Z | 2019-12-04T14:45:30.000Z | """Backward difference contrast encoding"""
import copy
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from patsy.highlevel import dmatrix
from category_encoders.ordinal import OrdinalEncoder
from category_encoders.utils import get_obj_cols, convert_input
__author__ = ... | 31.40796 | 112 | 0.61413 |
import copy
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from patsy.highlevel import dmatrix
from category_encoders.ordinal import OrdinalEncoder
from category_encoders.utils import get_obj_cols, convert_input
__author__ = 'willmcginnis'
class BackwardDifferenceEnc... | true | true |
1c1ba4d805fa31a7175f108a7550af2e909c6207 | 6,461 | py | Python | alipay/aop/api/request/AlipayMobilePublicAccountResetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayMobilePublicAccountResetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayMobilePublicAccountResetRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayMobilePublicAccountResetRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._a... | 31.364078 | 174 | 0.63597 |
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayMobilePublicAccountResetRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._agreement_id = None
self._bind_accoun... | true | true |
1c1ba5380ede1b5cbdf3cd7d066e966017480d9a | 7,082 | py | Python | jasmin_api/rest_api/views/mtrouter.py | muriloventuroso/jasmin-api | a3ce619be2730abb425a7fa076e866cd4afbd628 | [
"Apache-2.0"
] | null | null | null | jasmin_api/rest_api/views/mtrouter.py | muriloventuroso/jasmin-api | a3ce619be2730abb425a7fa076e866cd4afbd628 | [
"Apache-2.0"
] | null | null | null | jasmin_api/rest_api/views/mtrouter.py | muriloventuroso/jasmin-api | a3ce619be2730abb425a7fa076e866cd4afbd628 | [
"Apache-2.0"
] | 1 | 2019-11-20T17:55:01.000Z | 2019-11-20T17:55:01.000Z | from collections import OrderedDict
from django.conf import settings
from django.http import JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from rest_framework.viewsets import ViewSet
from rest_framework.decorators import list_route
from rest_api.tools import set_ikeys, split_cols, sync_... | 37.871658 | 89 | 0.568766 | from collections import OrderedDict
from django.conf import settings
from django.http import JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from rest_framework.viewsets import ViewSet
from rest_framework.decorators import list_route
from rest_api.tools import set_ikeys, split_cols, sync_... | true | true |
1c1ba5502818ed46ce22b316c6c5c63a004dfc55 | 1,134 | py | Python | app/version.py | geoadmin/service-wmts | 107e663c8e2a4c9f1c1faa69413627b47fea0952 | [
"BSD-3-Clause"
] | null | null | null | app/version.py | geoadmin/service-wmts | 107e663c8e2a4c9f1c1faa69413627b47fea0952 | [
"BSD-3-Clause"
] | 2 | 2022-01-26T15:57:00.000Z | 2022-01-31T13:00:36.000Z | app/version.py | geoadmin/service-wmts | 107e663c8e2a4c9f1c1faa69413627b47fea0952 | [
"BSD-3-Clause"
] | null | null | null | import subprocess
# Note that this file is overwritten during the build
# process by either the git tag of the commit
# (see Dockerfile for details)
# By default we expect to find a lightweight tag in
# the history
# This has the form 'v[0-9]+\.[0-9]+\.[0-9]+-beta.[0-9]' if
# the tag is directly related to the commit... | 40.5 | 71 | 0.62963 | import subprocess
with subprocess.Popen(["git", "describe", "--tags"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE) as proc:
stdout, stderr = proc.communicate()
GIT_VERSION = stdout.decode('utf-8').strip()
if GIT_VERSION == '':
with subprocess.... | true | true |
1c1ba72476eb8bf270aae8d3570e9037b2bf9d45 | 18,742 | py | Python | Manager/modules/sql/welcome_sql.py | lakshaysharmadehi/Manager | d13ea365fd2193af739ac941d3cfeaaea338fb46 | [
"MIT"
] | 17 | 2020-08-08T18:12:55.000Z | 2021-09-29T16:37:18.000Z | Manager/modules/sql/welcome_sql.py | lakshaysharmadehi/Manager | d13ea365fd2193af739ac941d3cfeaaea338fb46 | [
"MIT"
] | 3 | 2020-12-29T03:48:57.000Z | 2020-12-29T03:59:31.000Z | Manager/modules/sql/welcome_sql.py | lakshaysharmadehi/Manager | d13ea365fd2193af739ac941d3cfeaaea338fb46 | [
"MIT"
] | 79 | 2020-07-19T14:43:26.000Z | 2022-02-28T23:23:22.000Z | import random
import threading
from typing import Union
from sqlalchemy import Column, String, Boolean, UnicodeText, Integer, BigInteger
from Manager.modules.helper_funcs.msg_types import Types
from Manager.modules.sql import SESSION, BASE
DEFAULT_WELCOME = 'Hey {first}, how are you?'
DEFAULT_GOODBYE = 'Nice knowing... | 34.579336 | 113 | 0.658628 | import random
import threading
from typing import Union
from sqlalchemy import Column, String, Boolean, UnicodeText, Integer, BigInteger
from Manager.modules.helper_funcs.msg_types import Types
from Manager.modules.sql import SESSION, BASE
DEFAULT_WELCOME = 'Hey {first}, how are you?'
DEFAULT_GOODBYE = 'Nice knowing... | true | true |
1c1ba8810e30dc6d4613e249f6d2e37f78f9561e | 1,527 | py | Python | money/money/money.py | dmitrvk/tdd | c9fafad47516e6335ea5193d5ca123484a8a34b1 | [
"MIT"
] | null | null | null | money/money/money.py | dmitrvk/tdd | c9fafad47516e6335ea5193d5ca123484a8a34b1 | [
"MIT"
] | null | null | null | money/money/money.py | dmitrvk/tdd | c9fafad47516e6335ea5193d5ca123484a8a34b1 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
from .currency import Currency
from .expression import Expression
if TYPE_CHECKING:
from .bank import Bank
class Money(Expression):
def __init__(self, amount: int, currency: str) -> None:
self._amount: int = amount
self._currency: str = currency
@staticm... | 25.45 | 63 | 0.624754 | from typing import TYPE_CHECKING
from .currency import Currency
from .expression import Expression
if TYPE_CHECKING:
from .bank import Bank
class Money(Expression):
def __init__(self, amount: int, currency: str) -> None:
self._amount: int = amount
self._currency: str = currency
@staticm... | true | true |
1c1ba9aff129fd56ae97d56a3aab8045d899a01a | 2,656 | py | Python | tutorials/render_rllib_leduc_holdem.py | carlosluis/PettingZoo | aec87907777e0e62652d499b3ac96f680acf35ad | [
"Apache-2.0"
] | 846 | 2020-05-12T05:55:00.000Z | 2021-10-08T19:38:40.000Z | tutorials/render_rllib_leduc_holdem.py | carlosluis/PettingZoo | aec87907777e0e62652d499b3ac96f680acf35ad | [
"Apache-2.0"
] | 237 | 2020-04-27T06:01:39.000Z | 2021-10-13T02:55:54.000Z | tutorials/render_rllib_leduc_holdem.py | carlosluis/PettingZoo | aec87907777e0e62652d499b3ac96f680acf35ad | [
"Apache-2.0"
] | 126 | 2020-05-29T04:20:29.000Z | 2021-10-13T05:31:12.000Z | import ray
import pickle5 as pickle
from ray.tune.registry import register_env
from ray.rllib.agents.dqn import DQNTrainer
from pettingzoo.classic import leduc_holdem_v4
import supersuit as ss
from ray.rllib.env.wrappers.pettingzoo_env import PettingZooEnv
import PIL
from ray.rllib.models import ModelCatalog
import num... | 29.842697 | 234 | 0.737952 | import ray
import pickle5 as pickle
from ray.tune.registry import register_env
from ray.rllib.agents.dqn import DQNTrainer
from pettingzoo.classic import leduc_holdem_v4
import supersuit as ss
from ray.rllib.env.wrappers.pettingzoo_env import PettingZooEnv
import PIL
from ray.rllib.models import ModelCatalog
import num... | true | true |
1c1ba9bd25e88a6e8f182b4aee15b4c2ef46361e | 213 | py | Python | jolang/interpreter/file.py | jonatan1609/JoLang | 177d18d18b42834c2d624a1050902cc799d7d638 | [
"MIT"
] | 25 | 2021-11-04T11:59:18.000Z | 2022-03-10T20:20:10.000Z | jolang/interpreter/file.py | jonatan1609/JoLang | 177d18d18b42834c2d624a1050902cc799d7d638 | [
"MIT"
] | null | null | null | jolang/interpreter/file.py | jonatan1609/JoLang | 177d18d18b42834c2d624a1050902cc799d7d638 | [
"MIT"
] | 1 | 2022-02-07T21:00:27.000Z | 2022-02-07T21:00:27.000Z | class File:
def __init__(self, code: str, name: str, ast):
self.lines = code.splitlines()
self.name = name
self.ast = ast
def line(self, number):
return self.lines[number]
| 23.666667 | 50 | 0.58216 | class File:
def __init__(self, code: str, name: str, ast):
self.lines = code.splitlines()
self.name = name
self.ast = ast
def line(self, number):
return self.lines[number]
| true | true |
1c1baa096c5269149167ce74c2102834cc6cbeb0 | 3,646 | py | Python | clearml_agent/helper/console.py | aljeshishe/clearml-agent | 2fff28845d4d5c84135f24162e7dab185d13c9d5 | [
"Apache-2.0"
] | 60 | 2020-12-23T18:40:45.000Z | 2022-03-26T13:23:45.000Z | clearml_agent/helper/console.py | aljeshishe/clearml-agent | 2fff28845d4d5c84135f24162e7dab185d13c9d5 | [
"Apache-2.0"
] | 53 | 2020-12-29T07:52:40.000Z | 2022-03-31T10:11:54.000Z | clearml_agent/helper/console.py | aljeshishe/clearml-agent | 2fff28845d4d5c84135f24162e7dab185d13c9d5 | [
"Apache-2.0"
] | 24 | 2021-01-05T17:41:15.000Z | 2022-03-23T08:25:01.000Z | from __future__ import unicode_literals, print_function
import csv
import sys
from collections import Iterable
from typing import List, Dict, Text, Any
from attr import attrs, attrib
import six
from six import binary_type, text_type
from clearml_agent.helper.base import nonstrict_in_place_sort
def print_text(text,... | 30.638655 | 94 | 0.600658 | from __future__ import unicode_literals, print_function
import csv
import sys
from collections import Iterable
from typing import List, Dict, Text, Any
from attr import attrs, attrib
import six
from six import binary_type, text_type
from clearml_agent.helper.base import nonstrict_in_place_sort
def print_text(text,... | true | true |
1c1baa66eedcabaaa9b29f6986be55ad20c2edd0 | 3,484 | py | Python | svm.py | nivedit1/TwitterSentimentAnalysis | 972fdb46fab6f07748d685b94b80450cb5131c5f | [
"Apache-2.0"
] | null | null | null | svm.py | nivedit1/TwitterSentimentAnalysis | 972fdb46fab6f07748d685b94b80450cb5131c5f | [
"Apache-2.0"
] | null | null | null | svm.py | nivedit1/TwitterSentimentAnalysis | 972fdb46fab6f07748d685b94b80450cb5131c5f | [
"Apache-2.0"
] | 2 | 2018-12-06T02:58:29.000Z | 2019-04-18T19:23:25.000Z | from sklearn import svm,metrics
import numpy as np
import matplotlib as plt
from sklearn.decomposition import PCA
import datetime
# from mlxtend.plotting import plot_decision_regions
def predict_svm(x,y,z,clf):
clf.fit(x, y)
predicted = clf.predict(z)
return predicted
# def make_meshgrid(x, y, h=.02):
# ... | 30.831858 | 77 | 0.575775 | from sklearn import svm,metrics
import numpy as np
import matplotlib as plt
from sklearn.decomposition import PCA
import datetime
def predict_svm(x,y,z,clf):
clf.fit(x, y)
predicted = clf.predict(z)
return predicted
#
# Parameters
# ----------
# x: data to base x-axis meshgrid on
# y: d... | true | true |
1c1baa73e6c729ff9aab24ffbe42e535c88a4fb3 | 741 | py | Python | raveler/ray/ray/features/io.py | VCG/gp | cd106b604f8670a70add469d41180e34df3b1068 | [
"MIT"
] | 60 | 2015-02-28T05:37:24.000Z | 2022-03-14T10:12:48.000Z | gala/features/io.py | DocSavage/gala | a41d0c52fd09b5e34804b9c6082778a75dfc03c1 | [
"BSD-3-Clause"
] | 48 | 2015-02-04T00:36:01.000Z | 2021-12-21T22:48:43.000Z | gala/features/io.py | DocSavage/gala | a41d0c52fd09b5e34804b9c6082778a75dfc03c1 | [
"BSD-3-Clause"
] | 27 | 2015-01-23T07:40:18.000Z | 2022-03-04T10:44:38.000Z | from . import base
from . import inclusion, moments, histogram
def create_fm(fm_info):
children = []
for feature in fm_info['feature_list']:
if feature == "histogram":
children.append(histogram.Manager.load_dict(fm_info[feature]))
elif feature == "moments":
children.appe... | 35.285714 | 74 | 0.641026 | from . import base
from . import inclusion, moments, histogram
def create_fm(fm_info):
children = []
for feature in fm_info['feature_list']:
if feature == "histogram":
children.append(histogram.Manager.load_dict(fm_info[feature]))
elif feature == "moments":
children.appe... | true | true |
1c1bac2144e2acd030f6e19ec75534ca70d8984f | 2,284 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_landmarks_points.py | TolyaTalamanov/open_model_zoo | 1697e60712df4ca72635a2080a197b9d3bc24129 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_landmarks_points.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_landmarks_points.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | """
Copyright (c) 2018-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 35.6875 | 113 | 0.667688 |
import numpy as np
from ..config import BoolField
from ..postprocessor.postprocessor import Postprocessor
from ..representation import FacialLandmarksAnnotation, FacialLandmarksPrediction
class NormalizeLandmarksPoints(Postprocessor):
__provider__ = 'normalize_landmarks_points'
annotation_types = (FacialLa... | true | true |
1c1bac463bd91d61020f9bf6c412bf5022747de8 | 125 | py | Python | api/admin.py | curioswati/docshare | 24d52cd8dac5d69820988844033b3fa9aa357d80 | [
"MIT"
] | null | null | null | api/admin.py | curioswati/docshare | 24d52cd8dac5d69820988844033b3fa9aa357d80 | [
"MIT"
] | null | null | null | api/admin.py | curioswati/docshare | 24d52cd8dac5d69820988844033b3fa9aa357d80 | [
"MIT"
] | null | null | null | from api.models import Document
from django.contrib import admin
# Register your models here.
admin.site.register(Document)
| 20.833333 | 32 | 0.816 | from api.models import Document
from django.contrib import admin
admin.site.register(Document)
| true | true |
1c1bad85d60acbe4aff93eca498443ea610e5c3f | 944 | py | Python | wts/tests/xmlhttprequest/w3c/resources/redirect.py | Acidburn0zzz/web-testing-service | 1b46978e27a2e04f322d0f05f606ee96716642aa | [
"BSD-3-Clause"
] | null | null | null | wts/tests/xmlhttprequest/w3c/resources/redirect.py | Acidburn0zzz/web-testing-service | 1b46978e27a2e04f322d0f05f606ee96716642aa | [
"BSD-3-Clause"
] | null | null | null | wts/tests/xmlhttprequest/w3c/resources/redirect.py | Acidburn0zzz/web-testing-service | 1b46978e27a2e04f322d0f05f606ee96716642aa | [
"BSD-3-Clause"
] | null | null | null | from urlparse import urlparse
def main(request, response):
try:
code = int(request.GET.first("code", 302))
location = request.GET.first("location", request.url_parts.path +"?followed")
allowed_links = ["http://example.not", "mailto:someone@example.org", "http://example.not", "foobar:someon... | 44.952381 | 163 | 0.637712 | from urlparse import urlparse
def main(request, response):
try:
code = int(request.GET.first("code", 302))
location = request.GET.first("location", request.url_parts.path +"?followed")
allowed_links = ["http://example.not", "mailto:someone@example.org", "http://example.not", "foobar:someon... | false | true |
1c1bafd9a184ef2dc1d6c69f4235703925c6ea55 | 11,777 | py | Python | gmso/core/forcefield.py | zijiewu3/gmso | 49217ca8daa6c8b01f6bc667d271a321b6f6f16a | [
"MIT"
] | null | null | null | gmso/core/forcefield.py | zijiewu3/gmso | 49217ca8daa6c8b01f6bc667d271a321b6f6f16a | [
"MIT"
] | null | null | null | gmso/core/forcefield.py | zijiewu3/gmso | 49217ca8daa6c8b01f6bc667d271a321b6f6f16a | [
"MIT"
] | null | null | null | import typing
from collections import ChainMap
from lxml import etree
from gmso.utils.ff_utils import (validate,
parse_ff_metadata,
parse_ff_atomtypes,
parse_ff_connection_types)
def _group_by_expression(potential_typ... | 36.574534 | 103 | 0.630551 | import typing
from collections import ChainMap
from lxml import etree
from gmso.utils.ff_utils import (validate,
parse_ff_metadata,
parse_ff_atomtypes,
parse_ff_connection_types)
def _group_by_expression(potential_typ... | true | true |
1c1bb0ed38c48875db4456ecc8adaeea2ebdcd28 | 1,977 | py | Python | tests/regressiontests/createsuperuser/tests.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | 2 | 2015-08-03T22:04:14.000Z | 2015-08-03T22:04:16.000Z | tests/regressiontests/createsuperuser/tests.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | null | null | null | tests/regressiontests/createsuperuser/tests.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | 1 | 2019-07-15T02:35:16.000Z | 2019-07-15T02:35:16.000Z | from StringIO import StringIO
from django.contrib.auth import models
from django.contrib.auth.management.commands import changepassword
from django.core.management import call_command
from django.test import TestCase
class MultiDBChangepasswordManagementCommandTestCase(TestCase):
multi_db = True
def setUp(s... | 34.086207 | 122 | 0.692969 | from StringIO import StringIO
from django.contrib.auth import models
from django.contrib.auth.management.commands import changepassword
from django.core.management import call_command
from django.test import TestCase
class MultiDBChangepasswordManagementCommandTestCase(TestCase):
multi_db = True
def setUp(s... | true | true |
1c1bb12e91d22d84722647856de9b2854ea4139a | 3,882 | py | Python | bot.py | brandonnly/avgl-match-bot | ed4c2771acfbe1c771ae4b4d1c988fd4f06b2760 | [
"MIT"
] | null | null | null | bot.py | brandonnly/avgl-match-bot | ed4c2771acfbe1c771ae4b4d1c988fd4f06b2760 | [
"MIT"
] | null | null | null | bot.py | brandonnly/avgl-match-bot | ed4c2771acfbe1c771ae4b4d1c988fd4f06b2760 | [
"MIT"
] | null | null | null | import datetime
from datetime import timezone
import discord
from discord.ext import commands
from settings import *
intents = discord.Intents.default()
allowed_mentions = discord.AllowedMentions(everyone=False,
users=True,
roles=T... | 39.612245 | 83 | 0.519835 | import datetime
from datetime import timezone
import discord
from discord.ext import commands
from settings import *
intents = discord.Intents.default()
allowed_mentions = discord.AllowedMentions(everyone=False,
users=True,
roles=T... | true | true |
1c1bb1b694e5fe5a095abad64632d574a69f926a | 793 | py | Python | mysite/mysite/urls.py | KevBarbour/RASSblogv1 | 4a6f1827f16166f8ce260a29297ad5834683487e | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | KevBarbour/RASSblogv1 | 4a6f1827f16166f8ce260a29297ad5834683487e | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | KevBarbour/RASSblogv1 | 4a6f1827f16166f8ce260a29297ad5834683487e | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.478261 | 77 | 0.701135 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
] | true | true |
1c1bb1fa0099e606024e522400ba5c73d6811b49 | 701 | py | Python | Python-Advanced/file_handling/word_count.py | Xamaneone/SoftUni-Intro | 985fe3249cd2adf021c2003372e840219811d989 | [
"MIT"
] | null | null | null | Python-Advanced/file_handling/word_count.py | Xamaneone/SoftUni-Intro | 985fe3249cd2adf021c2003372e840219811d989 | [
"MIT"
] | null | null | null | Python-Advanced/file_handling/word_count.py | Xamaneone/SoftUni-Intro | 985fe3249cd2adf021c2003372e840219811d989 | [
"MIT"
] | null | null | null | import re
def get_file_content(file):
with open(file) as file:
text = ''.join(file.readlines())
return re.findall(r"[a-z']+", text.lower())
def write_result(res):
with open('Words Count/output.txt', 'w') as file:
for r in res:
file.write(r+"\n")
path_to_words = 'Words Coun... | 25.962963 | 88 | 0.659058 | import re
def get_file_content(file):
with open(file) as file:
text = ''.join(file.readlines())
return re.findall(r"[a-z']+", text.lower())
def write_result(res):
with open('Words Count/output.txt', 'w') as file:
for r in res:
file.write(r+"\n")
path_to_words = 'Words Coun... | true | true |
1c1bb2c176a0da0e2b7722e333580222f912b6da | 3,226 | py | Python | dataduct/steps/pipeline_dependencies.py | PlowzandMowz/dataduct | 4c58f495645d74ffc019fbf0b18034aec8a134e6 | [
"Apache-2.0"
] | null | null | null | dataduct/steps/pipeline_dependencies.py | PlowzandMowz/dataduct | 4c58f495645d74ffc019fbf0b18034aec8a134e6 | [
"Apache-2.0"
] | 2 | 2017-03-09T21:13:49.000Z | 2018-08-29T23:08:18.000Z | dataduct/steps/pipeline_dependencies.py | recurly/dataduct | 29aec3526e170e5ad3b59a135780e72b69209f0b | [
"Apache-2.0"
] | 1 | 2020-05-12T08:54:38.000Z | 2020-05-12T08:54:38.000Z | """
ETL step for pipeline dependencies using transform step
"""
from ..config import Config
from ..utils import constants as const
from .transform import TransformStep
config = Config()
NAME_PREFIX = config.etl.get('NAME_PREFIX', '')
DEPENDENCY_OVERRIDE = config.etl.get('DEPENDENCY_OVERRIDE', False)
SNS_TOPIC_ARN = co... | 34.319149 | 79 | 0.603534 | from ..config import Config
from ..utils import constants as const
from .transform import TransformStep
config = Config()
NAME_PREFIX = config.etl.get('NAME_PREFIX', '')
DEPENDENCY_OVERRIDE = config.etl.get('DEPENDENCY_OVERRIDE', False)
SNS_TOPIC_ARN = config.etl.get('SNS_TOPIC_ARN_FAILURE', None)
class PipelineDepe... | true | true |
1c1bb30480def1446f5cb342de05da0cbea6cf97 | 4,023 | py | Python | workalendar/asia/china.py | steinfurt/workalendar | 0c004e014e6aa4e800bf127579813e517eb0ee74 | [
"MIT"
] | null | null | null | workalendar/asia/china.py | steinfurt/workalendar | 0c004e014e6aa4e800bf127579813e517eb0ee74 | [
"MIT"
] | null | null | null | workalendar/asia/china.py | steinfurt/workalendar | 0c004e014e6aa4e800bf127579813e517eb0ee74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import date
import warnings
from ..core import ChineseNewYearCalendar, WesternCalendar
from ..registry import iso_register
from ..exceptions import CalendarError
holidays ... | 38.682692 | 78 | 0.53741 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import date
import warnings
from ..core import ChineseNewYearCalendar, WesternCalendar
from ..registry import iso_register
from ..exceptions import CalendarError
holidays = {
2018:
{... | true | true |
1c1bb40c231b2c0c7ebceec483c456ea56daaee9 | 387 | py | Python | web/src/additional_settings/cacheops_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 4 | 2021-03-11T07:37:36.000Z | 2021-09-19T07:58:41.000Z | web/src/additional_settings/cacheops_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 1 | 2021-11-21T07:48:41.000Z | 2021-11-21T07:48:41.000Z | web/src/additional_settings/cacheops_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 6 | 2021-03-24T09:01:23.000Z | 2021-09-18T13:16:34.000Z | from os import environ
REDIS_URL = environ.get('REDIS_URL')
REDIS_UNIX_SOCKET_PATH = environ.get('REDIS_UNIX_SOCKET_PATH')
CACHEOPS_REDIS = {
'host': 'redis',
'port': 6379,
'db': 1,
'socket_timeout': 3,
'unix_socket_path': REDIS_UNIX_SOCKET_PATH
}
CACHEOPS_DEFAULTS = {
'timeout': 60 * 60
}
C... | 18.428571 | 62 | 0.643411 | from os import environ
REDIS_URL = environ.get('REDIS_URL')
REDIS_UNIX_SOCKET_PATH = environ.get('REDIS_UNIX_SOCKET_PATH')
CACHEOPS_REDIS = {
'host': 'redis',
'port': 6379,
'db': 1,
'socket_timeout': 3,
'unix_socket_path': REDIS_UNIX_SOCKET_PATH
}
CACHEOPS_DEFAULTS = {
'timeout': 60 * 60
}
C... | true | true |
1c1bb454b362b918bcaac87f37df6ad8467fe4ef | 765 | py | Python | projects/example6/example6/urls.py | soundgnome/django-db-design | 2e653464de5111a8d234a70996e60bf7ad52d13e | [
"MIT"
] | 1 | 2017-11-30T03:27:59.000Z | 2017-11-30T03:27:59.000Z | projects/example6/example6/urls.py | soundgnome/django-db-design | 2e653464de5111a8d234a70996e60bf7ad52d13e | [
"MIT"
] | null | null | null | projects/example6/example6/urls.py | soundgnome/django-db-design | 2e653464de5111a8d234a70996e60bf7ad52d13e | [
"MIT"
] | null | null | null | """example6 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 34.772727 | 79 | 0.704575 | from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
| true | true |
1c1bb4bbdac825467445e7c12d4405ff0a38b858 | 6,346 | py | Python | clue-multitemplogger/clue-multitemplogger.py | kevinjwalters/circuitpython-examples | 2db14c7bc4217832dbefb6ba6abea2de2b46ed6b | [
"MIT"
] | 8 | 2019-02-21T02:55:57.000Z | 2022-03-27T00:19:26.000Z | clue-multitemplogger/clue-multitemplogger.py | kevinjwalters/circuitpython-examples | 2db14c7bc4217832dbefb6ba6abea2de2b46ed6b | [
"MIT"
] | null | null | null | clue-multitemplogger/clue-multitemplogger.py | kevinjwalters/circuitpython-examples | 2db14c7bc4217832dbefb6ba6abea2de2b46ed6b | [
"MIT"
] | 1 | 2020-09-30T20:03:40.000Z | 2020-09-30T20:03:40.000Z | ### clue-mutlitemplogger.py v1.2
### Measure temperature from multiple sensors and log to CIRCUITPY
### This now writes every 6 minutes to REDUCE THE WEAR on the flash chip
### (replacing this involves SMD soldering!)
### See https://forums.adafruit.com/viewtopic.php?f=65&t=175527
### Tested with Adafruit CLUE and Ci... | 33.052083 | 82 | 0.677119 | true | true | |
1c1bb4d0637838f8e08f1adf2d568247a61a09a5 | 57 | py | Python | examples/codeop/seed/seed5.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | examples/codeop/seed/seed5.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | examples/codeop/seed/seed5.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | x = 5
y = 10
x, y = y, x
print("x =", x)
print("y =", y)
| 9.5 | 15 | 0.403509 | x = 5
y = 10
x, y = y, x
print("x =", x)
print("y =", y)
| true | true |
1c1bb5c92210d1a2eef9f85f9a249c5efd4e66ae | 5,783 | py | Python | managedtenants/bundles/imageset_creator.py | vkareh/managed-tenants-cli | e311475d8c9ab5f2c47be4cf2fbe49a15784460e | [
"Apache-2.0"
] | null | null | null | managedtenants/bundles/imageset_creator.py | vkareh/managed-tenants-cli | e311475d8c9ab5f2c47be4cf2fbe49a15784460e | [
"Apache-2.0"
] | null | null | null | managedtenants/bundles/imageset_creator.py | vkareh/managed-tenants-cli | e311475d8c9ab5f2c47be4cf2fbe49a15784460e | [
"Apache-2.0"
] | null | null | null | import logging
import yaml
from gitlab.exceptions import GitlabCreateError, GitlabError
from sretoolbox.utils.logger import get_text_logger
from managedtenants.bundles.exceptions import ImageSetCreatorError
from managedtenants.bundles.utils import read_env_or_fail
from managedtenants.utils.gitlab_client import GitLab... | 37.070513 | 80 | 0.583261 | import logging
import yaml
from gitlab.exceptions import GitlabCreateError, GitlabError
from sretoolbox.utils.logger import get_text_logger
from managedtenants.bundles.exceptions import ImageSetCreatorError
from managedtenants.bundles.utils import read_env_or_fail
from managedtenants.utils.gitlab_client import GitLab... | true | true |
1c1bb61cfa3148d4fea78f621a73147d5442f96f | 494 | py | Python | a2ml/cmdl/commands/cmd_evaluate.py | gitter-badger/a2ml | 1d9ef6657645b61c64090284ed8fadb1a68b932c | [
"Apache-2.0"
] | 2 | 2020-04-09T16:59:22.000Z | 2020-04-09T17:01:10.000Z | a2ml/cmdl/commands/cmd_evaluate.py | arita37/a2ml | 3e92bede2c2ef6e63be74560cc6b904d3ec9d931 | [
"Apache-2.0"
] | null | null | null | a2ml/cmdl/commands/cmd_evaluate.py | arita37/a2ml | 3e92bede2c2ef6e63be74560cc6b904d3ec9d931 | [
"Apache-2.0"
] | null | null | null | import click
from a2ml.api.a2ml import A2ML
from a2ml.api.utils.context import pass_context
@click.command('evaluate', short_help='Evaluate models after training.')
@click.argument('run-id', required=False, type=click.STRING)
@click.option('--provider', '-p', type=click.STRING, required=False,
help='Cloud AutoML ... | 32.933333 | 72 | 0.736842 | import click
from a2ml.api.a2ml import A2ML
from a2ml.api.utils.context import pass_context
@click.command('evaluate', short_help='Evaluate models after training.')
@click.argument('run-id', required=False, type=click.STRING)
@click.option('--provider', '-p', type=click.STRING, required=False,
help='Cloud AutoML ... | true | true |
1c1bb68200f61f5a76bf1d41ecf49b1ac5ee8591 | 5,207 | py | Python | sdk/lusid/models/transaction_property_mapping.py | mneedham/lusid-sdk-python | edabec16b357ba3fc48a53f3faacb4f94b18843e | [
"MIT"
] | null | null | null | sdk/lusid/models/transaction_property_mapping.py | mneedham/lusid-sdk-python | edabec16b357ba3fc48a53f3faacb4f94b18843e | [
"MIT"
] | null | null | null | sdk/lusid/models/transaction_property_mapping.py | mneedham/lusid-sdk-python | edabec16b357ba3fc48a53f3faacb4f94b18843e | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2808
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class TransactionPropertyMapping(object):
"""NOTE: ... | 27.696809 | 98 | 0.579412 |
import pprint
import re
import six
class TransactionPropertyMapping(object):
openapi_types = {
'property_key': 'str',
'map_from': 'str',
'set_to': 'object'
}
attribute_map = {
'property_key': 'propertyKey',
'map_from': 'mapFrom',
'set_to': 'setTo'
... | true | true |
1c1bb780758da47a6784d40f6d5285930f832a01 | 4,486 | py | Python | losses/focal_loss.py | Kaiseem/PointNu-Net | d56e6638567202e9a75956b74b53e1d4fe599865 | [
"MIT"
] | 1 | 2022-03-07T12:50:49.000Z | 2022-03-07T12:50:49.000Z | losses/focal_loss.py | Kaiseem/PointNu-Net | d56e6638567202e9a75956b74b53e1d4fe599865 | [
"MIT"
] | 3 | 2021-12-04T16:27:49.000Z | 2022-02-24T09:11:12.000Z | losses/focal_loss.py | Kaiseem/PointNu-Net | d56e6638567202e9a75956b74b53e1d4fe599865 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def binary_focal_loss(x, y, alpha=0.25, gamma=2., reduction='none'):
pt = x.detach() * (y.detach() * 2 - 1)
w = (1 - pt).pow(gamma)
w[y == 0] *= (1 - alpha)
w[y > 0] *= alpha
# a = torch.where(y < 0, alp... | 41.537037 | 134 | 0.575791 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def binary_focal_loss(x, y, alpha=0.25, gamma=2., reduction='none'):
pt = x.detach() * (y.detach() * 2 - 1)
w = (1 - pt).pow(gamma)
w[y == 0] *= (1 - alpha)
w[y > 0] *= alpha
loss = F.binary_cross_e... | true | true |
1c1bb7a8f2ed9feacc9df49f33d2be6a4f19a32f | 6,060 | py | Python | utils/benchmarks.py | namjiseong/greenfood | c2612a2cb93631cd9e2f543db230a829a35b7fa3 | [
"MIT"
] | null | null | null | utils/benchmarks.py | namjiseong/greenfood | c2612a2cb93631cd9e2f543db230a829a35b7fa3 | [
"MIT"
] | null | null | null | utils/benchmarks.py | namjiseong/greenfood | c2612a2cb93631cd9e2f543db230a829a35b7fa3 | [
"MIT"
] | null | null | null | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Run YOLOv5 benchmarks on all supported export formats
Format | `export.py --include` | Model
--- | --- | ---
PyTorch | - | yolov5s.pt
TorchScrip... | 41.793103 | 120 | 0.582673 |
import argparse
import sys
import time
from pathlib import Path
import pandas as pd
FILE = Path(__file__).resolve()
ROOT = FILE.parents[1]
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT))
xport
import val
from utils import notebook_init
from utils.general import LOGGER, print_args
from utils.torch_u... | true | true |
1c1bb7b39dfbeec4ca8ab8c26c99ab17a5a2967c | 1,749 | py | Python | src/PageScraper.py | sadobin/Crawl3r | bb0d15968da3020eb937800f6a5e027beb33f4a3 | [
"MIT"
] | 1 | 2021-05-31T06:39:25.000Z | 2021-05-31T06:39:25.000Z | src/PageScraper.py | sadobin/Crawl3r | bb0d15968da3020eb937800f6a5e027beb33f4a3 | [
"MIT"
] | null | null | null | src/PageScraper.py | sadobin/Crawl3r | bb0d15968da3020eb937800f6a5e027beb33f4a3 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
import os, sys
sys.path.append( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) )
from bs4 import BeautifulSoup, Comment
from config import HTML_ATTRIBUTES, HTML_TAGS
import re
class PageScraper:
def __init__(self, page_content):
self.comments = []
se... | 23.32 | 83 | 0.540881 |
import os, sys
sys.path.append( os.path.dirname( os.path.dirname( os.path.realpath(__file__) ) ) )
from bs4 import BeautifulSoup, Comment
from config import HTML_ATTRIBUTES, HTML_TAGS
import re
class PageScraper:
def __init__(self, page_content):
self.comments = []
self.links = []
... | true | true |
1c1bb837c2862eca41baf137b3fc36edb74476f6 | 2,131 | py | Python | wstest.py | ulikoehler/Translatron | d7fb609364fa3f8879c18f4e0af7da1bda47a208 | [
"Apache-2.0"
] | null | null | null | wstest.py | ulikoehler/Translatron | d7fb609364fa3f8879c18f4e0af7da1bda47a208 | [
"Apache-2.0"
] | null | null | null | wstest.py | ulikoehler/Translatron | d7fb609364fa3f8879c18f4e0af7da1bda47a208 | [
"Apache-2.0"
] | 1 | 2020-07-29T07:08:59.000Z | 2020-07-29T07:08:59.000Z | #!/usr/bin/env python3
###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the ... | 32.784615 | 79 | 0.626466 | true | true | |
1c1bb86d1574d628d13b50eda84ca7f43530b17f | 190 | py | Python | Portfolio/display/views.py | tejoyv/Portfolio_Website | ffcd956f8922847f773668f4948fa170cf0433a1 | [
"bzip2-1.0.6"
] | null | null | null | Portfolio/display/views.py | tejoyv/Portfolio_Website | ffcd956f8922847f773668f4948fa170cf0433a1 | [
"bzip2-1.0.6"
] | null | null | null | Portfolio/display/views.py | tejoyv/Portfolio_Website | ffcd956f8922847f773668f4948fa170cf0433a1 | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render
from .models import Profile
# Create your views here.
def home(request):
profile=Profile.objects
return render(request,'home.html',{'profile':profile}) | 27.142857 | 55 | 0.784211 | from django.shortcuts import render
from .models import Profile
def home(request):
profile=Profile.objects
return render(request,'home.html',{'profile':profile}) | true | true |
1c1bb87f27f186786a1f98fbb4ef0e7477356c78 | 914 | py | Python | config/_custom/SCTD001/faster_rcnn_dartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | null | null | null | config/_custom/SCTD001/faster_rcnn_dartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | null | null | null | config/_custom/SCTD001/faster_rcnn_dartsnet_fpn.py | automlresearch/autodetector | e959baf589fb329509cd25edcab11c7d22ea5e7e | [
"Apache-2.0"
] | 1 | 2021-12-08T08:28:16.000Z | 2021-12-08T08:28:16.000Z | # _base_ = [
# '../_base_/models/faster_rcnn_r50_fpn.py',
# '../_base_/datasets/coco_detection.py',
# '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
# ]
_base_ = [
'../../_base_/models/SCTD/faster_rcnn_mydartsnet_nasfpn.py',
'../../_base_/datasets/voc_sctd_nasfpn.py',
# '../.... | 24.702703 | 74 | 0.673961 |
_base_ = [
'../../_base_/models/SCTD/faster_rcnn_mydartsnet_nasfpn.py',
'../../_base_/datasets/voc_sctd_nasfpn.py',
'../../_base_/default_runtime.py'
]
data = dict(
samples_per_gpu=6,
workers_per_gpu=0)
optimizer = dict(
type='SGD',
lr=0.01,
momentum=0.9,
weight_decay=0.0001,... | true | true |
1c1bb889eeea5abc4df8accc1e1bd232d69e0cae | 5,659 | py | Python | conf.py | servicosgovbr/manual-avaliacao | 0fc2aece77d2142b0d5763f9e2bc39194223f8b0 | [
"MIT"
] | 4 | 2020-02-06T00:37:14.000Z | 2021-01-29T20:58:57.000Z | conf.py | servicosgovbr/manual-avaliacao | 0fc2aece77d2142b0d5763f9e2bc39194223f8b0 | [
"MIT"
] | 1 | 2022-03-03T13:31:41.000Z | 2022-03-14T13:28:49.000Z | conf.py | servicosgovbr/manual-avaliacao | 0fc2aece77d2142b0d5763f9e2bc39194223f8b0 | [
"MIT"
] | 3 | 2019-05-02T17:15:39.000Z | 2021-12-16T15:04:39.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.923497 | 111 | 0.660187 |
project = u'Manual de uso da API de Avaliação e Acompanhamento'
copyright = u'2018, servicos.gov.br'
author = u'servicos.gov.br'
version = u''
release = u''
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.imgconverter',
]
templates_path = ['_te... | true | true |
1c1bb89a4df4b8d89592137999b99b412c04809b | 148 | py | Python | adopcion/apps.py | NeelBit/mascotas_gsm | 5bb2a2c6a347dacf24d19d60d7eebe0c8849d7b2 | [
"CC0-1.0"
] | null | null | null | adopcion/apps.py | NeelBit/mascotas_gsm | 5bb2a2c6a347dacf24d19d60d7eebe0c8849d7b2 | [
"CC0-1.0"
] | null | null | null | adopcion/apps.py | NeelBit/mascotas_gsm | 5bb2a2c6a347dacf24d19d60d7eebe0c8849d7b2 | [
"CC0-1.0"
] | null | null | null | from django.apps import AppConfig
class AdopcionConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'adopcion'
| 21.142857 | 56 | 0.763514 | from django.apps import AppConfig
class AdopcionConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'adopcion'
| true | true |
1c1bb9bbcab7d738a3fc5bb138b219b8277f80ae | 1,680 | py | Python | CCC 2017/Q3.py | milbin/Waterloo-CCC-solutions | ae66bcdb3abb069ae00618eab6e0ba6c62a90dc8 | [
"MIT"
] | 2 | 2019-06-26T15:20:20.000Z | 2019-10-19T18:02:11.000Z | CCC 2017/Q3.py | milbin/Waterloo-CCC-solutions | ae66bcdb3abb069ae00618eab6e0ba6c62a90dc8 | [
"MIT"
] | null | null | null | CCC 2017/Q3.py | milbin/Waterloo-CCC-solutions | ae66bcdb3abb069ae00618eab6e0ba6c62a90dc8 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.read().splitlines()
N = int(input[0])
boardsInput = input[1].split(' ')
boards = []
for board in boardsInput:
boards.append(int(board))
boards = sorted(boards)
boardsRemainingCopy = {}
for board in boards:
boardsRemainingCopy[board] = boards.count(board)
maxLenOfFence = int(boards... | 27.540984 | 91 | 0.629762 | import sys
input = sys.stdin.read().splitlines()
N = int(input[0])
boardsInput = input[1].split(' ')
boards = []
for board in boardsInput:
boards.append(int(board))
boards = sorted(boards)
boardsRemainingCopy = {}
for board in boards:
boardsRemainingCopy[board] = boards.count(board)
maxLenOfFence = int(boards... | true | true |
1c1bbade31bca98ecc80a21cee107e8036c837ee | 1,912 | py | Python | zipJson2tsv.py | edres-baadani/arabic-sentiment-analysis | 588be9edd0d55914fc1a64701de32e295c1c213e | [
"Apache-2.0"
] | 61 | 2019-01-03T13:09:28.000Z | 2022-02-23T04:22:25.000Z | zipJson2tsv.py | edres-baadani/arabic-sentiment-analysis | 588be9edd0d55914fc1a64701de32e295c1c213e | [
"Apache-2.0"
] | 2 | 2020-01-11T16:21:36.000Z | 2021-05-16T06:47:17.000Z | zipJson2tsv.py | edres-baadani/arabic-sentiment-analysis | 588be9edd0d55914fc1a64701de32e295c1c213e | [
"Apache-2.0"
] | 35 | 2019-01-08T14:58:32.000Z | 2021-12-14T14:06:26.000Z | import json
import zipfile
import preprocessor as tweet_processor
from filter_tweets import *
from textutil import *
tweet_processor.set_options(tweet_processor.OPT.URL,
tweet_processor.OPT.MENTION,
tweet_processor.OPT.NUMBER,
tweet_... | 32.40678 | 77 | 0.530335 | import json
import zipfile
import preprocessor as tweet_processor
from filter_tweets import *
from textutil import *
tweet_processor.set_options(tweet_processor.OPT.URL,
tweet_processor.OPT.MENTION,
tweet_processor.OPT.NUMBER,
tweet_... | true | true |
1c1bbbb08368f490d7564137c0ca0914814fe190 | 24,101 | py | Python | dask/dataframe/io/tests/test_io.py | alikefia/dask | 99ecc8e64cc70b55dc598197574a5b602a82da83 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_io.py | alikefia/dask | 99ecc8e64cc70b55dc598197574a5b602a82da83 | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/tests/test_io.py | alikefia/dask | 99ecc8e64cc70b55dc598197574a5b602a82da83 | [
"BSD-3-Clause"
] | null | null | null | import contextlib
from concurrent.futures import ThreadPoolExecutor
from threading import Lock
import numpy as np
import pandas as pd
import pytest
import dask.array as da
import dask.dataframe as dd
from dask.dataframe._compat import tm
from dask.dataframe.io.io import _meta_from_array
from dask.dataframe.utils impo... | 31.795515 | 88 | 0.593876 | import contextlib
from concurrent.futures import ThreadPoolExecutor
from threading import Lock
import numpy as np
import pandas as pd
import pytest
import dask.array as da
import dask.dataframe as dd
from dask.dataframe._compat import tm
from dask.dataframe.io.io import _meta_from_array
from dask.dataframe.utils impo... | true | true |
1c1bbbb5620c291837e725d12ccac97a2e41bd26 | 3,428 | py | Python | j2cli/cli.py | apnarm/j2cli | 37642eb3aa2f21136735214576d644f573870c5d | [
"BSD-2-Clause"
] | null | null | null | j2cli/cli.py | apnarm/j2cli | 37642eb3aa2f21136735214576d644f573870c5d | [
"BSD-2-Clause"
] | null | null | null | j2cli/cli.py | apnarm/j2cli | 37642eb3aa2f21136735214576d644f573870c5d | [
"BSD-2-Clause"
] | null | null | null | import os, sys
import argparse
import jinja2
import jinja2.loaders
from . import __version__
from .context import read_context_data, FORMATS
from .extras import filters
class FilePathLoader(jinja2.BaseLoader):
""" Custom Jinja2 template loader which just loads a single template file """
def __init__(self, ... | 26.992126 | 118 | 0.596266 | import os, sys
import argparse
import jinja2
import jinja2.loaders
from . import __version__
from .context import read_context_data, FORMATS
from .extras import filters
class FilePathLoader(jinja2.BaseLoader):
def __init__(self, cwd, encoding='utf-8'):
self.cwd = cwd
self.encoding = encoding
... | true | true |
1c1bbc33e8b44b08a5089c2ce46fd58126ff8c1b | 873 | py | Python | rotate_array/solution.py | mahimadubey/leetcode-python | 38acc65fa4315f86acb62874ca488620c5d77e17 | [
"BSD-2-Clause"
] | 528 | 2015-01-08T21:27:06.000Z | 2022-03-17T09:23:44.000Z | rotate_array/solution.py | durgaharish1993/leetcode-python | 6c523ef4759a57433e10271b584eece16f9f05f3 | [
"BSD-2-Clause"
] | null | null | null | rotate_array/solution.py | durgaharish1993/leetcode-python | 6c523ef4759a57433e10271b584eece16f9f05f3 | [
"BSD-2-Clause"
] | 278 | 2015-01-12T06:45:17.000Z | 2022-02-20T08:09:22.000Z | """
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to
[5,6,7,1,2,3,4].
Note:
Try to come up as many solutions as you can, there are at least 3 different
ways to solve this problem.
"""
class Solution(object):
def rotate(self, nums, k... | 21.825 | 75 | 0.531501 |
class Solution(object):
def rotate(self, nums, k):
n = len(nums)
k = k % n
self.reverse(nums, 0, n - 1)
self.reverse(nums, 0, k - 1)
self.reverse(nums, k, n - 1)
def reverse(self, nums, i, j):
while i < j:
nums[i], nums[j] = nums[j], nums[i]
... | true | true |
1c1bbc3f5ba90b329f168a262aa801fb709c0584 | 6,425 | py | Python | fluidfoam/openfoamsimu.py | jchauchat/fluidfoam | f5b720bd1f4f4213a173709a67a25e10879d6cec | [
"CECILL-B"
] | null | null | null | fluidfoam/openfoamsimu.py | jchauchat/fluidfoam | f5b720bd1f4f4213a173709a67a25e10879d6cec | [
"CECILL-B"
] | null | null | null | fluidfoam/openfoamsimu.py | jchauchat/fluidfoam | f5b720bd1f4f4213a173709a67a25e10879d6cec | [
"CECILL-B"
] | null | null | null | import os, sys
import subprocess
from fluidfoam import readmesh, readfield
class Error(Exception):
pass
class DirectorySimuError(Error):
def __init__(self, simu):
super(DirectorySimuError,self).__init__(
"No directory found for simulation named {}".format(simu))
class OpenFoamSimu(obj... | 34.358289 | 89 | 0.577743 | import os, sys
import subprocess
from fluidfoam import readmesh, readfield
class Error(Exception):
pass
class DirectorySimuError(Error):
def __init__(self, simu):
super(DirectorySimuError,self).__init__(
"No directory found for simulation named {}".format(simu))
class OpenFoamSimu(obj... | true | true |
1c1bbc45500b3976303a8fea008db4b18167229a | 1,005 | py | Python | droidlet/dialog/load_datasets.py | ali-senguel/fairo | 1ec5d8ecbdfc782de63a92aad9bf8534110ce762 | [
"MIT"
] | 669 | 2020-11-21T01:20:20.000Z | 2021-09-13T13:25:16.000Z | droidlet/dialog/load_datasets.py | ali-senguel/fairo | 1ec5d8ecbdfc782de63a92aad9bf8534110ce762 | [
"MIT"
] | 324 | 2020-12-07T18:20:34.000Z | 2021-09-14T17:17:18.000Z | droidlet/dialog/load_datasets.py | ali-senguel/fairo | 1ec5d8ecbdfc782de63a92aad9bf8534110ce762 | [
"MIT"
] | 56 | 2021-01-04T19:57:40.000Z | 2021-09-13T21:20:08.000Z | import json
import os
import pkg_resources
def get_safety_words():
"""
Extract the set of safety words from safety file
and return
"""
safety_words = set()
safety_words_path = "{}/{}".format(
pkg_resources.resource_filename("droidlet.documents", "internal"), "safety.txt"
)
if o... | 31.40625 | 87 | 0.60597 | import json
import os
import pkg_resources
def get_safety_words():
safety_words = set()
safety_words_path = "{}/{}".format(
pkg_resources.resource_filename("droidlet.documents", "internal"), "safety.txt"
)
if os.path.isfile(safety_words_path):
with open(safety_words_path) as f:
... | true | true |
1c1bbc4a17da1b5a8631d491e38aa68ba4e878f2 | 3,970 | py | Python | scripts/get_ljspeech_data.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 1 | 2020-11-05T09:39:59.000Z | 2020-11-05T09:39:59.000Z | scripts/get_ljspeech_data.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 1 | 2020-06-11T00:54:42.000Z | 2020-06-11T00:54:42.000Z | scripts/get_ljspeech_data.py | ParikhKadam/NeMo | ee11f7c4666d410d91f9da33c61f4819ea625013 | [
"Apache-2.0"
] | 3 | 2020-03-10T05:10:07.000Z | 2020-12-08T01:33:35.000Z | # Copyright (c) 2019 NVIDIA Corporation
#
# USAGE: python get_ljspeech_data.py --data_root=<where to put data>
import argparse
import json
import logging
import os
import random
import tarfile
import urllib.request
from scipy.io.wavfile import read
URL = "https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2"
... | 30.075758 | 77 | 0.645844 |
import argparse
import json
import logging
import os
import random
import tarfile
import urllib.request
from scipy.io.wavfile import read
URL = "https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2"
def __maybe_download_file(destination: str, source: str):
source = URL
if not os.path.exists(destin... | true | true |
1c1bbc83bfe3f24cb6003d5c23f782c2dd47632e | 6,636 | py | Python | examples/voxceleb/feature_recipes.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 7 | 2020-12-29T19:35:58.000Z | 2022-01-31T21:01:30.000Z | examples/voxceleb/feature_recipes.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 3 | 2020-02-06T16:44:17.000Z | 2020-09-26T05:26:14.000Z | examples/voxceleb/feature_recipes.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 6 | 2019-02-14T01:36:28.000Z | 2020-10-30T13:16:32.000Z | from odin import nnet as N
from odin import preprocessing as pp
from utils import WAV_FILES
def bnf_sad(debugging):
bnf_network = N.models.BNF_2048_MFCC40()
recipe = pp.make_pipeline(steps=[
pp.speech.AudioReader(sr=16000, sr_new=8000,
best_resample=True, remove_dc=True),
pp... | 51.046154 | 79 | 0.53692 | from odin import nnet as N
from odin import preprocessing as pp
from utils import WAV_FILES
def bnf_sad(debugging):
bnf_network = N.models.BNF_2048_MFCC40()
recipe = pp.make_pipeline(steps=[
pp.speech.AudioReader(sr=16000, sr_new=8000,
best_resample=True, remove_dc=True),
pp... | true | true |
1c1bbd69a774b22b0cd2b15f29ad62275041eee7 | 3,957 | py | Python | fieldArray.py | IASBSWCL/FSO | e0e8be4bec6b568ceeac2fbf47c56153efe75f2b | [
"MIT"
] | null | null | null | fieldArray.py | IASBSWCL/FSO | e0e8be4bec6b568ceeac2fbf47c56153efe75f2b | [
"MIT"
] | null | null | null | fieldArray.py | IASBSWCL/FSO | e0e8be4bec6b568ceeac2fbf47c56153efe75f2b | [
"MIT"
] | null | null | null | from field import field
import random
class fieldArray(field):
array = []
def __init__(self, arraySize, fieldSize):
self.arraySize = arraySize
self.fieldSize = fieldSize
self.array = [field(fieldSize, 0) for x in range(arraySize)]
def fillRandom(self):
for i in range(self... | 32.975 | 93 | 0.613596 | from field import field
import random
class fieldArray(field):
array = []
def __init__(self, arraySize, fieldSize):
self.arraySize = arraySize
self.fieldSize = fieldSize
self.array = [field(fieldSize, 0) for x in range(arraySize)]
def fillRandom(self):
for i in range(self... | true | true |
1c1bbe99f1e5766853d1b9a29fea8f214cd371a1 | 1,850 | py | Python | linear_model/linear_reg.py | guessable/machineLearning | 69be1f53918c29d27c1a8707ea92ce71c0cc1bfb | [
"MIT"
] | 5 | 2020-09-13T09:41:49.000Z | 2022-03-27T01:22:23.000Z | linear_model/linear_reg.py | guessable/machineLearning | 69be1f53918c29d27c1a8707ea92ce71c0cc1bfb | [
"MIT"
] | null | null | null | linear_model/linear_reg.py | guessable/machineLearning | 69be1f53918c29d27c1a8707ea92ce71c0cc1bfb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
'''
线性回归,岭回归
'''
import numpy as np
import matplotlib.pyplot as plt
def data_generater(x):
'''
生成样本
'''
epsilon = np.random.normal(loc=0, scale=1.0, size=len(x))
y = 3*x + 1 + 0.1*epsilon
return y
def LinReg():
'''
线性回归
y = \omega x... | 19.072165 | 66 | 0.569189 |
import numpy as np
import matplotlib.pyplot as plt
def data_generater(x):
epsilon = np.random.normal(loc=0, scale=1.0, size=len(x))
y = 3*x + 1 + 0.1*epsilon
return y
def LinReg():
x = np.linspace(0, 1, 500)
y = data_generater(x)
x = x.reshape(-1, 1)
y = y.reshape(-1, 1)
x_hat ... | true | true |
1c1bbed835f977bb459c7583a609b2657fe6b0be | 350 | py | Python | l10n_ar_account_global_discount/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | 1 | 2021-01-25T15:57:58.000Z | 2021-01-25T15:57:58.000Z | l10n_ar_account_global_discount/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | null | null | null | l10n_ar_account_global_discount/__init__.py | odoo-mastercore/odoo-argentina | 58cdfe8610bae42f69ddb9d652a28eb3245f6a04 | [
"MIT"
] | 2 | 2020-10-17T16:36:02.000Z | 2021-01-24T10:20:05.000Z | # -*- coding: utf-8 -*-
##############################################################################
# Author: SINAPSYS GLOBAL SA || MASTERCORE SAS
# Copyleft: 2020-Present.
# License LGPL-3.0 or later (http: //www.gnu.org/licenses/lgpl.html).
#
#
######################################################################... | 38.888889 | 79 | 0.368571 | true | true | |
1c1bbf5e75569148707f6057e2ca7fd9b97af6cb | 706 | py | Python | workbooks/migrations/0007_auto_20190708_1144.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 13 | 2016-01-14T02:43:10.000Z | 2020-11-25T20:43:05.000Z | workbooks/migrations/0007_auto_20190708_1144.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 84 | 2015-11-20T02:03:33.000Z | 2021-10-14T19:24:24.000Z | workbooks/migrations/0007_auto_20190708_1144.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 5 | 2015-11-25T19:29:53.000Z | 2019-09-04T17:37:52.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-07-08 18:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workbooks', '0006_worksheet_gene_type'),
]
operations = [
migrations.Alter... | 27.153846 | 120 | 0.601983 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workbooks', '0006_worksheet_gene_type'),
]
operations = [
migrations.AlterField(
model_name='workbook_perms',
name='perm',... | true | true |
1c1bbf9143e1f69e3c8c646a300325ac19218199 | 34,395 | py | Python | tests/test_cli.py | soumik12345/client | 31e4c2b143e6c219ea005fe4477e294f383f6888 | [
"MIT"
] | null | null | null | tests/test_cli.py | soumik12345/client | 31e4c2b143e6c219ea005fe4477e294f383f6888 | [
"MIT"
] | null | null | null | tests/test_cli.py | soumik12345/client | 31e4c2b143e6c219ea005fe4477e294f383f6888 | [
"MIT"
] | null | null | null | import contextlib
import datetime
import getpass
import importlib
import netrc
import os
import platform
import subprocess
import sys
import tempfile
import traceback
from unittest import mock
import pytest
import wandb
from wandb.cli import cli
from wandb.apis.internal import InternalApi
from tests import utils
DUM... | 33.328488 | 88 | 0.579183 | import contextlib
import datetime
import getpass
import importlib
import netrc
import os
import platform
import subprocess
import sys
import tempfile
import traceback
from unittest import mock
import pytest
import wandb
from wandb.cli import cli
from wandb.apis.internal import InternalApi
from tests import utils
DUM... | true | true |
1c1bc176d2e147619ef602fb7a80d5f6140dc414 | 456 | py | Python | triple_agent/classes/lights.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 3 | 2020-04-25T11:42:03.000Z | 2020-07-08T16:38:26.000Z | triple_agent/classes/lights.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 17 | 2019-08-11T19:09:55.000Z | 2021-03-30T17:12:28.000Z | triple_agent/classes/lights.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | null | null | null | from enum import auto
from triple_agent.classes.ordered_enum import ReverseOrderedEnum
from triple_agent.constants.colors import PlotColorsBase
class Lights(ReverseOrderedEnum):
Lowlight = 0
Neutral = auto()
Highlight = auto()
def create_lights_color_dict(plot_colors: PlotColorsBase):
return {
... | 25.333333 | 64 | 0.747807 | from enum import auto
from triple_agent.classes.ordered_enum import ReverseOrderedEnum
from triple_agent.constants.colors import PlotColorsBase
class Lights(ReverseOrderedEnum):
Lowlight = 0
Neutral = auto()
Highlight = auto()
def create_lights_color_dict(plot_colors: PlotColorsBase):
return {
... | true | true |
1c1bc1f88a0f23255f6499ef18f74e29a82a696c | 2,526 | py | Python | Lib/site-packages/wx-2.8-msw-unicode/wx/lib/foldmenu.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 27 | 2020-11-12T19:24:54.000Z | 2022-03-27T23:10:45.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/lib/foldmenu.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 2 | 2020-11-02T06:30:39.000Z | 2022-02-23T18:39:55.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/lib/foldmenu.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 7 | 2018-02-13T10:22:39.000Z | 2019-07-04T07:39:28.000Z | # 12/07/2003 - Jeff Grimmett (grimmtooth@softhome.net)
#
# o 2.5 Compatability changes
#
import wx
from wx.lib.evtmgr import eventManager
class FoldOutWindow(wx.PopupWindow):
def __init__(self,parent,style=0):
wx.PopupWindow.__init__(self,parent,style)
self.SetAutoLayout(True)
self.sizer=w... | 28.066667 | 78 | 0.610847 |
import wx
from wx.lib.evtmgr import eventManager
class FoldOutWindow(wx.PopupWindow):
def __init__(self,parent,style=0):
wx.PopupWindow.__init__(self,parent,style)
self.SetAutoLayout(True)
self.sizer=wx.BoxSizer(wx.HORIZONTAL)
self.SetSizer(self.sizer, deleteOld=False)
... | true | true |
1c1bc3295ceb9c5ff741811c0b80d7a8394d97f3 | 479 | py | Python | mindapp/migrations/0023_auto_20200401_1233.py | isha27255/mindersnatch | 9c775141327d17f09518da5227763da45bf8ce4f | [
"BSD-3-Clause"
] | 5 | 2020-04-01T14:40:06.000Z | 2020-10-22T19:13:13.000Z | mindapp/migrations/0023_auto_20200401_1233.py | rishav4101/mindersnatch | afb2be1830106175e1317ea6596ec28bdbf20df4 | [
"BSD-3-Clause"
] | 8 | 2021-03-19T09:28:07.000Z | 2022-03-12T00:21:11.000Z | mindapp/migrations/0023_auto_20200401_1233.py | rishav4101/mindersnatch | afb2be1830106175e1317ea6596ec28bdbf20df4 | [
"BSD-3-Clause"
] | 9 | 2020-04-01T09:12:58.000Z | 2021-08-07T11:59:29.000Z | # Generated by Django 2.1.5 on 2020-04-01 07:03
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mindapp', '0022_auto_20200401_1213'),
]
operations = [
migrations.AlterField(
model_name='situa... | 23.95 | 102 | 0.645094 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mindapp', '0022_auto_20200401_1213'),
]
operations = [
migrations.AlterField(
model_name='situationtimer',
name='player',
... | true | true |
1c1bc3341635be5773274f82537d7032c3aa38ea | 2,009 | py | Python | classroom_tools/grading/create_grades.py | TestOrgJustAymeric/ClassroomTools | 034add9ad855a2909d0d413e42935c21a55da715 | [
"MIT"
] | null | null | null | classroom_tools/grading/create_grades.py | TestOrgJustAymeric/ClassroomTools | 034add9ad855a2909d0d413e42935c21a55da715 | [
"MIT"
] | null | null | null | classroom_tools/grading/create_grades.py | TestOrgJustAymeric/ClassroomTools | 034add9ad855a2909d0d413e42935c21a55da715 | [
"MIT"
] | 1 | 2021-01-17T04:00:25.000Z | 2021-01-17T04:00:25.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import os
from colorama import Fore
parser = argparse.ArgumentParser()
parser.add_argument(
'--test_associations_path',
required=True,
help='Path to test_associations.json'
)
def get_tests_results(log_file):
with o... | 30.907692 | 104 | 0.614734 |
import argparse
import json
import os
from colorama import Fore
parser = argparse.ArgumentParser()
parser.add_argument(
'--test_associations_path',
required=True,
help='Path to test_associations.json'
)
def get_tests_results(log_file):
with open(log_file) as f:
results = []
... | true | true |
1c1bc3b786d64c4e87fdf70cabd6c3cf9ec8e83b | 266 | py | Python | data.py | gazzar/loguetools | e45788b806595cb347ed163b03e4b03eb8c54a9e | [
"BSD-3-Clause"
] | 21 | 2020-05-24T14:07:38.000Z | 2021-12-11T01:46:21.000Z | data.py | dukesrg/loguetools | d3f62d571f19fb0415548f7b9de161062dfadb6f | [
"BSD-3-Clause"
] | 9 | 2020-10-14T11:33:39.000Z | 2021-04-26T20:23:48.000Z | data.py | GenevieveBuckley/loguetools | 23001b6e9615e72572394234ba3cb85fd1a9f811 | [
"BSD-3-Clause"
] | 4 | 2020-10-15T12:11:32.000Z | 2021-12-06T02:15:36.000Z | import os
root = os.path.dirname(__file__)
images = os.path.join(root, "icons/file_manager.ico")
images = os.path.join(root, "icons/convert_gray_to_color.ico")
images = os.path.join(root, "icons/disk_multiple.ico")
images = os.path.join(root, "icons/door_in.ico")
| 29.555556 | 62 | 0.744361 | import os
root = os.path.dirname(__file__)
images = os.path.join(root, "icons/file_manager.ico")
images = os.path.join(root, "icons/convert_gray_to_color.ico")
images = os.path.join(root, "icons/disk_multiple.ico")
images = os.path.join(root, "icons/door_in.ico")
| true | true |
1c1bc3b7d8c5b8a52a2d468091b43c41baf2a917 | 3,776 | py | Python | scrapers/scrape_so.py | loleg/covid_19 | 3fe3b1d3970591a32972157e8644be09ca2219c2 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_so.py | loleg/covid_19 | 3fe3b1d3970591a32972157e8644be09ca2219c2 | [
"CC-BY-4.0"
] | null | null | null | scrapers/scrape_so.py | loleg/covid_19 | 3fe3b1d3970591a32972157e8644be09ca2219c2 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from bs4 import BeautifulSoup
import scrape_common as sc
import scrape_so_common as soc
base_url = 'https://corona.so.ch'
pdf_url = soc.get_latest_weekly_pdf_url()
content = sc.pdfdownload(pdf_url, layout=True, silent=True, page=1)
"""
Hospitalisationen im Ka... | 37.386139 | 186 | 0.60196 |
import re
from bs4 import BeautifulSoup
import scrape_common as sc
import scrape_so_common as soc
base_url = 'https://corona.so.ch'
pdf_url = soc.get_latest_weekly_pdf_url()
content = sc.pdfdownload(pdf_url, layout=True, silent=True, page=1)
rows = []
date = sc.find(r'S\s?tand: (\d+\.\d+\.20\d{2})', content)
nu... | true | true |
1c1bc4591cbc5a4e7f11b6d149a50505eb4faa63 | 18,442 | py | Python | src/spn/tests/test_layerwise.py | steven-lang/SPFlow | be7492d4229857454b4e23596be7ba71d7af5960 | [
"Apache-2.0"
] | 199 | 2018-11-13T10:37:45.000Z | 2022-02-06T17:07:28.000Z | src/spn/tests/test_layerwise.py | steven-lang/SPFlow | be7492d4229857454b4e23596be7ba71d7af5960 | [
"Apache-2.0"
] | 46 | 2018-11-30T13:40:38.000Z | 2022-01-22T21:05:07.000Z | src/spn/tests/test_layerwise.py | steven-lang/SPFlow | be7492d4229857454b4e23596be7ba71d7af5960 | [
"Apache-2.0"
] | 78 | 2018-11-13T10:37:48.000Z | 2022-03-14T21:34:13.000Z | #!/usr/bin/env python3
import random
import unittest
import numpy as np
import torch
from torch import nn
from torch.distributions import Normal as TorchNormal
from torch.nn import functional as F
from spn.algorithms.layerwise import layers, distributions
from spn.algorithms.layerwise.type_checks import (
check_... | 38.103306 | 124 | 0.630951 |
import random
import unittest
import numpy as np
import torch
from torch import nn
from torch.distributions import Normal as TorchNormal
from torch.nn import functional as F
from spn.algorithms.layerwise import layers, distributions
from spn.algorithms.layerwise.type_checks import (
check_valid,
OutOfBounds... | true | true |
1c1bc45c773a1a8a7afb1573442dd573ebaa781e | 1,769 | py | Python | spacy/cli/converters/jsonl2json.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | spacy/cli/converters/jsonl2json.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | spacy/cli/converters/jsonl2json.py | gandersen101/spaCy | 109849bd311490f17a29b320cb032e43d153f36f | [
"MIT"
] | 2 | 2020-02-15T18:33:35.000Z | 2022-02-13T14:11:41.000Z | # coding: utf8
from __future__ import unicode_literals
import srsly
from ...gold import docs_to_json
from ...util import get_lang_class, minibatch
def ner_jsonl2json(input_data, lang=None, n_sents=10, use_morphology=False, **_):
if lang is None:
raise ValueError("No --lang specified, but tokenization re... | 32.759259 | 88 | 0.560769 |
from __future__ import unicode_literals
import srsly
from ...gold import docs_to_json
from ...util import get_lang_class, minibatch
def ner_jsonl2json(input_data, lang=None, n_sents=10, use_morphology=False, **_):
if lang is None:
raise ValueError("No --lang specified, but tokenization required")
j... | true | true |
1c1bc460f94d90f19a2e7b902ac367ced08001fb | 1,231 | py | Python | django/test_project/test_app/migrations/0001_initial.py | schaazzz/sandbox | 11ee1dc362568d3a30599cfc7acf85d69597c79a | [
"MIT"
] | null | null | null | django/test_project/test_app/migrations/0001_initial.py | schaazzz/sandbox | 11ee1dc362568d3a30599cfc7acf85d69597c79a | [
"MIT"
] | 8 | 2020-02-26T02:21:24.000Z | 2022-02-26T05:40:49.000Z | django/test_project/test_app/migrations/0001_initial.py | schaazzz/sandbox | 11ee1dc362568d3a30599cfc7acf85d69597c79a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-22 10:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | 31.564103 | 114 | 0.586515 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | true | true |
1c1bc487fcfb23de50905aa1059ed5c5c9b6f04e | 7,997 | py | Python | tests/offline/test_cleaning_events.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | null | null | null | tests/offline/test_cleaning_events.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | null | null | null | tests/offline/test_cleaning_events.py | franklouwers/maestral | 18434b6f651bdf94bb06dea1575d2c036be1b451 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import timeit
import pytest
from watchdog.events import (
FileCreatedEvent,
FileDeletedEvent,
FileModifiedEvent,
FileMovedEvent,
DirCreatedEvent,
DirDeletedEvent,
DirMovedEvent,
)
from maestral.sync import SyncEngine
from maestral.client import DropboxClient
from m... | 28.257951 | 88 | 0.617231 |
import timeit
import pytest
from watchdog.events import (
FileCreatedEvent,
FileDeletedEvent,
FileModifiedEvent,
FileMovedEvent,
DirCreatedEvent,
DirDeletedEvent,
DirMovedEvent,
)
from maestral.sync import SyncEngine
from maestral.client import DropboxClient
from maestral.config import r... | true | true |
1c1bc7480acd01d3c0e79c89eedc88219b832bb1 | 12,573 | py | Python | scripts/compute_rewards_on_video.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | scripts/compute_rewards_on_video.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | scripts/compute_rewards_on_video.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | # from multiworld.envs.mujoco.sawyer_xyz.sawyer_push_multiobj_subset import SawyerMultiobjectEnv
# from multiworld.envs.mujoco.sawyer_xyz.sawyer_reach import SawyerReachXYZEnv
import sys
from multiworld.core.image_env import ImageEnv
from multiworld.envs.real_world.sawyer.sawyer_reaching import SawyerReachXYZEnv
# fro... | 37.531343 | 149 | 0.609799 |
import sys
from multiworld.core.image_env import ImageEnv
from multiworld.envs.real_world.sawyer.sawyer_reaching import SawyerReachXYZEnv
from railrl.launchers.experiments.ashvin.rfeatures.encoder_wrapped_env import EncoderWrappedEnv
import torch
from railrl.launchers.experiments.ashvin.rfeatures.rfeatures_mode... | true | true |
1c1bc9cf660a08209f9c4bdae6c6f259ac860395 | 94 | py | Python | StreetMuse/lib/python3.4/re.py | Wojtechnology/Muzit | 41d509ed9c4f42974119c2ee292503c2396bc841 | [
"Apache-2.0"
] | null | null | null | StreetMuse/lib/python3.4/re.py | Wojtechnology/Muzit | 41d509ed9c4f42974119c2ee292503c2396bc841 | [
"Apache-2.0"
] | null | null | null | StreetMuse/lib/python3.4/re.py | Wojtechnology/Muzit | 41d509ed9c4f42974119c2ee292503c2396bc841 | [
"Apache-2.0"
] | null | null | null | /usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/re.py | 94 | 94 | 0.808511 | /usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/re.py | false | true |
1c1bcaa43a418250c1dccf003a29f41b155010be | 13,749 | py | Python | nlp_220/hw4/nlp_220_hw4.py | daohuei/ucsc-nlp-unicorn | d19c99fc717e458e6cfbf1bbe06193251257afb1 | [
"MIT"
] | null | null | null | nlp_220/hw4/nlp_220_hw4.py | daohuei/ucsc-nlp-unicorn | d19c99fc717e458e6cfbf1bbe06193251257afb1 | [
"MIT"
] | null | null | null | nlp_220/hw4/nlp_220_hw4.py | daohuei/ucsc-nlp-unicorn | d19c99fc717e458e6cfbf1bbe06193251257afb1 | [
"MIT"
] | null | null | null | import re
import json
from dateutil import parser
import tweepy
import pandas as pd
import numpy as np
from thefuzz import fuzz
import matplotlib
import matplotlib.pyplot as plt
from nltk.probability import FreqDist
from nltk.tokenize import word_tokenize
from sklearn.model_selection import StratifiedShuffleSplit
impo... | 34.719697 | 121 | 0.71387 | import re
import json
from dateutil import parser
import tweepy
import pandas as pd
import numpy as np
from thefuzz import fuzz
import matplotlib
import matplotlib.pyplot as plt
from nltk.probability import FreqDist
from nltk.tokenize import word_tokenize
from sklearn.model_selection import StratifiedShuffleSplit
impo... | true | true |
1c1bd1462769735b5ccc6e1a7797e8af67e60a20 | 1,023 | py | Python | reagent/gym/envs/wrappers/simple_minigrid.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/gym/envs/wrappers/simple_minigrid.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/gym/envs/wrappers/simple_minigrid.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import gym
import gym_minigrid # noqa
import numpy as np
from gym import spaces
from gym_minigrid.minigrid import DIR_TO_VEC
NUM_DIRECTIONS: int = len(DIR_TO_VEC)
class SimpleObsWrapper(gym.core.ObservationWrapper):
... | 26.230769 | 82 | 0.614858 |
import gym
import gym_minigrid
import numpy as np
from gym import spaces
from gym_minigrid.minigrid import DIR_TO_VEC
NUM_DIRECTIONS: int = len(DIR_TO_VEC)
class SimpleObsWrapper(gym.core.ObservationWrapper):
def __init__(self, env) -> None:
super().__init__(env)
self.observation_space = ... | true | true |
1c1bd2ae76faef65ea13c1ffc1bb7d275268c74e | 333 | py | Python | recommendations/user_score/migrations/0003_remove_userreview_user.py | Badisches-Landesmuseum/museum-recommendations-backend | 75ab4685d0a6ca89f945a9f590d8292a8002d64f | [
"MIT"
] | 1 | 2021-06-26T13:12:40.000Z | 2021-06-26T13:12:40.000Z | recommendations/user_score/migrations/0003_remove_userreview_user.py | Badisches-Landesmuseum/museum-recommendations-backend | 75ab4685d0a6ca89f945a9f590d8292a8002d64f | [
"MIT"
] | null | null | null | recommendations/user_score/migrations/0003_remove_userreview_user.py | Badisches-Landesmuseum/museum-recommendations-backend | 75ab4685d0a6ca89f945a9f590d8292a8002d64f | [
"MIT"
] | 1 | 2021-06-27T12:01:47.000Z | 2021-06-27T12:01:47.000Z | # Generated by Django 3.2.4 on 2021-06-27 11:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user_score', '0002_auto_20210626_1733'),
]
operations = [
migrations.RemoveField(
model_name='userreview',
name='user',
... | 18.5 | 50 | 0.597598 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('user_score', '0002_auto_20210626_1733'),
]
operations = [
migrations.RemoveField(
model_name='userreview',
name='user',
),
]
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.