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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71b1ab7a5127da844d3de34669b1e4ea7ec03cf | 4,069 | py | Python | tests/components/smartthings/test_lock.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | tests/components/smartthings/test_lock.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | tests/components/smartthings/test_lock.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """
Test for the SmartThings lock platform.
The only mocking required is of the underlying SmartThings API object so
real HTTP calls are not initiated during testing.
"""
from pysmartthings import Attribute, Capability
from pysmartthings.device import Status
from openpeerpower.components.lock import DOMAIN as LOCK_DO... | 36.330357 | 88 | 0.706562 | from pysmartthings import Attribute, Capability
from pysmartthings.device import Status
from openpeerpower.components.lock import DOMAIN as LOCK_DOMAIN
from openpeerpower.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE
from openpeerpower.config_entries import ConfigEntryState
from openpeerpower.c... | true | true |
f71b1af96cc4062163b2c26f68ca4f8e5e16759c | 21,877 | py | Python | scripts/linters/general_purpose_linter.py | ParitoshKabra/oppia | a8945a5ff28fcbe4eaca1e22d99ed4d3e82f2dca | [
"Apache-2.0"
] | 2 | 2022-02-24T14:06:42.000Z | 2022-02-24T14:11:05.000Z | scripts/linters/general_purpose_linter.py | ParitoshKabra/oppia | a8945a5ff28fcbe4eaca1e22d99ed4d3e82f2dca | [
"Apache-2.0"
] | null | null | null | scripts/linters/general_purpose_linter.py | ParitoshKabra/oppia | a8945a5ff28fcbe4eaca1e22d99ed4d3e82f2dca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 37.589347 | 80 | 0.581341 |
from __future__ import annotations
import os
import re
from . import js_ts_linter
from . import warranted_angular_security_bypasses
from .. import build
from .. import common
from .. import concurrent_task_utils
EXCLUDED_PATHS = (
'third_party/*', 'build/*', '.git/*', '*.pyc', 'CHANGELOG',
... | true | true |
f71b1b5dacb5a5c7e4853d46d9e70c5797445611 | 1,049 | py | Python | prxgt/domain/attribute.py | praxigento/teq_test_db_schema_attrs | 20ec030dc095c644d22631491e066697203d983d | [
"MIT"
] | null | null | null | prxgt/domain/attribute.py | praxigento/teq_test_db_schema_attrs | 20ec030dc095c644d22631491e066697203d983d | [
"MIT"
] | null | null | null | prxgt/domain/attribute.py | praxigento/teq_test_db_schema_attrs | 20ec030dc095c644d22631491e066697203d983d | [
"MIT"
] | null | null | null | __author__ = 'Alex Gusev <alex@flancer64.com>'
import prxgt.const as const
from prxgt.domain.meta.attribute import Attribute as AttributeBase
class Attribute(AttributeBase):
"""
Attribute model contains data.
"""
def __init__(self, name=None, type_=None, value=None):
super(Attribute, self).__... | 26.225 | 75 | 0.578646 | __author__ = 'Alex Gusev <alex@flancer64.com>'
import prxgt.const as const
from prxgt.domain.meta.attribute import Attribute as AttributeBase
class Attribute(AttributeBase):
def __init__(self, name=None, type_=None, value=None):
super(Attribute, self).__init__(name, type_)
self._value = value
... | true | true |
f71b1c721a28949ee40ddf327761ea6fcd2fe45b | 11,435 | py | Python | config/settings/common.py | devermaslinfy/rejot | 8c07a42a73be8422f16874684be3b46ab70b5c18 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T16:21:44.000Z | 2020-07-23T16:21:44.000Z | config/settings/common.py | devermaslinfy/rejot | 8c07a42a73be8422f16874684be3b46ab70b5c18 | [
"BSD-3-Clause"
] | 7 | 2020-02-12T01:21:01.000Z | 2022-03-11T23:25:57.000Z | config/settings/common.py | devermaslinfy/rejot | 8c07a42a73be8422f16874684be3b46ab70b5c18 | [
"BSD-3-Clause"
] | 1 | 2019-07-27T10:00:01.000Z | 2019-07-27T10:00:01.000Z | # -*- coding: utf-8 -*-
"""
Django settings for roojet project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_lite... | 33.338192 | 98 | 0.61784 |
from __future__ import absolute_import, unicode_literals
import environ
from decimal import Decimal
ROOT_DIR = environ.Path(__file__) - 3
APPS_DIR = ROOT_DIR.path('roojet')
env = environ.Env()
environ.Env.read_env(ROOT_DIR()+'/.env')
DJANGO_APPS = (
'django.contrib.auth',
'django.contrib.contentty... | true | true |
f71b1dc503a1e22e10ad5b8a916812053338361e | 3,578 | py | Python | appStore/tests.py | Rubensrvsc/Store | ab3a3aea6518b76d9d5de9c1b9e90236def8954d | [
"MIT"
] | null | null | null | appStore/tests.py | Rubensrvsc/Store | ab3a3aea6518b76d9d5de9c1b9e90236def8954d | [
"MIT"
] | null | null | null | appStore/tests.py | Rubensrvsc/Store | ab3a3aea6518b76d9d5de9c1b9e90236def8954d | [
"MIT"
] | null | null | null | from django.test import TestCase
from rest_framework.test import APIRequestFactory, APIClient
from .models import *
from rest_framework import status
# Create your tests here.
class ProductCategoryTest(TestCase):
@classmethod
def setUpTestData(cls):
ProductCategory.objects.create(name_product_category... | 31.663717 | 81 | 0.630799 | from django.test import TestCase
from rest_framework.test import APIRequestFactory, APIClient
from .models import *
from rest_framework import status
class ProductCategoryTest(TestCase):
@classmethod
def setUpTestData(cls):
ProductCategory.objects.create(name_product_category="Infantil")
Prod... | true | true |
f71b1e2fd58d30c28062d37e9f1ae54392548686 | 6,411 | py | Python | src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v1.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 43.910959 | 117 | 0.61644 |
from datadog_api_client.v1.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
)
def lazy_import():
from datadog_api_client.v1... | true | true |
f71b1e406ddf2cb9954d1454378cd13f4b53e7f4 | 1,801 | py | Python | nodes/wind.py | JavierRefuerzo/WeatherFlow | 5ea3669edfd7449797cef3184689d6c540383cde | [
"MIT"
] | 4 | 2018-08-26T02:40:09.000Z | 2020-06-21T22:59:04.000Z | nodes/wind.py | JavierRefuerzo/WeatherFlow | 5ea3669edfd7449797cef3184689d6c540383cde | [
"MIT"
] | 9 | 2018-04-20T15:37:46.000Z | 2020-07-15T20:22:31.000Z | nodes/wind.py | JavierRefuerzo/WeatherFlow | 5ea3669edfd7449797cef3184689d6c540383cde | [
"MIT"
] | 2 | 2018-09-16T23:13:39.000Z | 2021-12-20T16:35:20.000Z | #!/usr/bin/env python3
"""
Polyglot v2 node server for WeatherFlow Weather Station data.
Copyright (c) 2018,2019 Robert Paauwe
"""
import polyinterface
import sys
import time
import datetime
import urllib3
import json
import socket
import math
import threading
LOGGER = polyinterface.LOGGER
class WindNode(polyinterfac... | 29.52459 | 79 | 0.513048 |
import polyinterface
import sys
import time
import datetime
import urllib3
import json
import socket
import math
import threading
LOGGER = polyinterface.LOGGER
class WindNode(polyinterface.Node):
id = 'wind'
hint = [1,11,4,0]
units = 'metric'
drivers = [
{'driver': 'ST', 'value': 0, 'uom'... | true | true |
f71b1e9aa887b542b88ff076fa75931ec6dc85c7 | 2,532 | py | Python | cohesity_management_sdk/models/smb_active_file_path.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/smb_active_file_path.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/smb_active_file_path.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
import cohesity_management_sdk.models.smb_active_session
class SmbActiveFilePath(object):
"""Implementation of the 'SmbActiveFilePath' model.
Specifies a file path in an SMB view that has active sessions and opens.
Attributes:
active_sessio... | 32.461538 | 133 | 0.625197 |
import cohesity_management_sdk.models.smb_active_session
class SmbActiveFilePath(object):
_names = {
"active_sessions":'activeSessions',
"file_path":'filePath',
"view_id":'viewId',
"view_name":'viewName'
}
def __init__(self,
active_sessions=None,
... | true | true |
f71b206d98b3712aa33781c5090859c94fbf8680 | 373 | py | Python | source/Objects/XTRA_Solvers_Class.py | afarahi/XTRA | 6550b216264abaa3ed705835aca0981f2934e069 | [
"MIT"
] | 2 | 2018-11-01T12:38:56.000Z | 2019-10-22T07:02:54.000Z | source/Objects/XTRA_Solvers_Class.py | afarahi/XTRA | 6550b216264abaa3ed705835aca0981f2934e069 | [
"MIT"
] | null | null | null | source/Objects/XTRA_Solvers_Class.py | afarahi/XTRA | 6550b216264abaa3ed705835aca0981f2934e069 | [
"MIT"
] | null | null | null | class Solvers_Class():
def __init__(self):
pass
def ProperDistanceTabulate(self, Input_Param, z_max):
from Distance_Solver import Proper_Distance_Tabulate
Proper_Distance_Tabulate(Input_Param, z_max)
def LxTxSolver(self, Halos):
from LxTx_Solver import LxTx_Solver
... | 23.3125 | 60 | 0.691689 | class Solvers_Class():
def __init__(self):
pass
def ProperDistanceTabulate(self, Input_Param, z_max):
from Distance_Solver import Proper_Distance_Tabulate
Proper_Distance_Tabulate(Input_Param, z_max)
def LxTxSolver(self, Halos):
from LxTx_Solver import LxTx_Solver
... | true | true |
f71b20c6a58525d0ad6e5a5b0ad92dbbdf9f5849 | 1,599 | py | Python | user/tests.py | Vr3n/django_react_cart_system | f6d2572b640f711ff9c7020641051e3f92c3dd59 | [
"MIT"
] | null | null | null | user/tests.py | Vr3n/django_react_cart_system | f6d2572b640f711ff9c7020641051e3f92c3dd59 | [
"MIT"
] | 3 | 2021-06-18T15:13:46.000Z | 2021-06-18T18:24:43.000Z | user/tests.py | Vr3n/django_react_cart_system | f6d2572b640f711ff9c7020641051e3f92c3dd59 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
# Create your tests here.
class UserManagersTests(TestCase):
def test_create_user(self):
User = get_user_model()
user = User.objects.create_user(
email="normal@user.com", password="testing@123")
s... | 34.76087 | 70 | 0.642276 | from django.contrib.auth import get_user_model
from django.test import TestCase
class UserManagersTests(TestCase):
def test_create_user(self):
User = get_user_model()
user = User.objects.create_user(
email="normal@user.com", password="testing@123")
self.assertEqual(user.emai... | true | true |
f71b21a5dd538deb30896fbf0e23be55c42a7ec4 | 22 | py | Python | tsu/__init__.py | KiraDank/tsu | 7a2c6508daf6d797e8371acf3b473d0f92cb11c3 | [
"MIT"
] | 251 | 2019-08-18T17:19:19.000Z | 2022-03-31T20:38:20.000Z | tsu/__init__.py | KiraDank/tsu | 7a2c6508daf6d797e8371acf3b473d0f92cb11c3 | [
"MIT"
] | 37 | 2019-09-05T08:03:00.000Z | 2022-01-27T12:49:50.000Z | tsu/__init__.py | KiraDank/tsu | 7a2c6508daf6d797e8371acf3b473d0f92cb11c3 | [
"MIT"
] | 20 | 2019-09-01T15:29:56.000Z | 2022-01-27T03:03:18.000Z | __version__ = '3.1.2'
| 11 | 21 | 0.636364 | __version__ = '3.1.2'
| true | true |
f71b21c32e28c3f04700fe8235f89c2fac3de98b | 3,420 | py | Python | ays_api/app.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | null | null | null | ays_api/app.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | 332 | 2016-05-24T10:51:45.000Z | 2021-09-08T12:28:50.000Z | ays_api/app.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | 1 | 2016-08-02T07:52:49.000Z | 2016-08-02T07:52:49.000Z | from flask import Flask, send_from_directory, make_response, request, send_file, jsonify
import werkzeug.exceptions
from jose import jwt, exceptions
import wtforms_json
from .ays import ays_api
from .oauth import oauth_api
from .webhooks import webhooks_api
from .cockpit import cockpit_api
from JumpScale import j
app... | 28.264463 | 108 | 0.625146 | from flask import Flask, send_from_directory, make_response, request, send_file, jsonify
import werkzeug.exceptions
from jose import jwt, exceptions
import wtforms_json
from .ays import ays_api
from .oauth import oauth_api
from .webhooks import webhooks_api
from .cockpit import cockpit_api
from JumpScale import j
app... | true | true |
f71b21ee28dbbf48f0569576807de49f2234149c | 3,475 | py | Python | include/Node.py | Yperidis/DAGFLOW | 84ea30eea480e095dc8e24f80ca84a733170a365 | [
"MIT"
] | null | null | null | include/Node.py | Yperidis/DAGFLOW | 84ea30eea480e095dc8e24f80ca84a733170a365 | [
"MIT"
] | null | null | null | include/Node.py | Yperidis/DAGFLOW | 84ea30eea480e095dc8e24f80ca84a733170a365 | [
"MIT"
] | null | null | null | import random
import networkx as nx
class Node:
def __init__(self, ID=None, message=None, highercmnd=None, lev=None,
parent=None, childNo=None, children_list=None,
cmndlineup=None, cmndnodes=None, ancestor_list=None,
descendant_list=None):
self.ID = ID # an... | 39.942529 | 122 | 0.606906 | import random
import networkx as nx
class Node:
def __init__(self, ID=None, message=None, highercmnd=None, lev=None,
parent=None, childNo=None, children_list=None,
cmndlineup=None, cmndnodes=None, ancestor_list=None,
descendant_list=None):
self.ID = ID
... | true | true |
f71b22fcc5f5f5eba2d54b6f00ae8b7fb89c6a76 | 2,334 | py | Python | cltk/utils/frequency.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | null | null | null | cltk/utils/frequency.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | null | null | null | cltk/utils/frequency.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | 1 | 2019-06-16T06:41:47.000Z | 2019-06-16T06:41:47.000Z | """This module's main class reads a text corpus and assembles a list of n
most common words."""
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
from cltk.corpus.utils.formatter import assemble_tlg_author_filepaths
from cltk.corpus.utils.formatter import assemble_phi... | 39.559322 | 97 | 0.670094 |
__author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>'
__license__ = 'MIT License. See LICENSE.'
from cltk.corpus.utils.formatter import assemble_tlg_author_filepaths
from cltk.corpus.utils.formatter import assemble_phi5_author_filepaths
from cltk.corpus.utils.formatter import tlg_plaintext_cleanup
from cltk.corpu... | true | true |
f71b22feb4672df4c2b53105a50c79c3c5c48548 | 3,225 | py | Python | Midterm/server.py | eebbk-zhou/Web-Design-1 | 98703942dbb58e15c38a07de551a78398e2a7ab1 | [
"Unlicense"
] | null | null | null | Midterm/server.py | eebbk-zhou/Web-Design-1 | 98703942dbb58e15c38a07de551a78398e2a7ab1 | [
"Unlicense"
] | null | null | null | Midterm/server.py | eebbk-zhou/Web-Design-1 | 98703942dbb58e15c38a07de551a78398e2a7ab1 | [
"Unlicense"
] | null | null | null | from bottle import route, get, post
from bottle import run, debug
from bottle import request, response, redirect, template
from bottle import static_file
import dataset
import json
from bottle import default_app
#http://localhost:8090
@route("/")
def get_midterm():
todo_list_db = dataset.connect('sqlite:///to... | 26.434426 | 84 | 0.622636 | from bottle import route, get, post
from bottle import run, debug
from bottle import request, response, redirect, template
from bottle import static_file
import dataset
import json
from bottle import default_app
@route("/")
def get_midterm():
todo_list_db = dataset.connect('sqlite:///todo_list.db')
todo_... | true | true |
f71b23bfc71f48b0e7ac2b5989a80a9a6d09b17b | 4,803 | py | Python | CA/ca.py | PIR3-Internet/server | 181962e392be47a39848f3a88703163a140b3d3a | [
"MIT"
] | null | null | null | CA/ca.py | PIR3-Internet/server | 181962e392be47a39848f3a88703163a140b3d3a | [
"MIT"
] | null | null | null | CA/ca.py | PIR3-Internet/server | 181962e392be47a39848f3a88703163a140b3d3a | [
"MIT"
] | null | null | null | import ssl
import socket
import OpenSSL
import sqlite3
import signal
from functools import wraps
from numpy.core.numeric import count_nonzero
import requests
from multiprocessing import Process, Value
TIMEOUT = Value('i', 5)
cMax = Value('i', 2)
ca_num = Value('i', 0)
class TimeoutException(Exception):
pass
def ... | 29.466258 | 128 | 0.564022 | import ssl
import socket
import OpenSSL
import sqlite3
import signal
from functools import wraps
from numpy.core.numeric import count_nonzero
import requests
from multiprocessing import Process, Value
TIMEOUT = Value('i', 5)
cMax = Value('i', 2)
ca_num = Value('i', 0)
class TimeoutException(Exception):
pass
def ... | true | true |
f71b2498aa5fdb11b49d58a54f14653f45df1cb1 | 10,087 | py | Python | docs/sphinx/conf.py | sdss/lvmscraper | 5b169487963fd06000c0a593993bb3c2c9418951 | [
"BSD-3-Clause"
] | null | null | null | docs/sphinx/conf.py | sdss/lvmscraper | 5b169487963fd06000c0a593993bb3c2c9418951 | [
"BSD-3-Clause"
] | null | null | null | docs/sphinx/conf.py | sdss/lvmscraper | 5b169487963fd06000c0a593993bb3c2c9418951 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# type: igno... | 30.847095 | 84 | 0.652027 |
import os
from pkg_resources import parse_version
try:
from cluplus import __version__
except ModuleNotFoundError:
from sdsstools import get_package_version
__version__ = get_package_version(__file__, 'sdss-cluplus') or 'dev'
on_rtd = os.environ.get('READTHEDOCS') == 'True'
sphinx_templa... | true | true |
f71b252375625601941b43c73fbf023daa436c67 | 304 | py | Python | src/pygame_setup.py | sheepy0125/some-platformer-game | 5b623c7ffeb7d1e0ba8bf1d75bc37b1798f31379 | [
"MIT"
] | null | null | null | src/pygame_setup.py | sheepy0125/some-platformer-game | 5b623c7ffeb7d1e0ba8bf1d75bc37b1798f31379 | [
"MIT"
] | null | null | null | src/pygame_setup.py | sheepy0125/some-platformer-game | 5b623c7ffeb7d1e0ba8bf1d75bc37b1798f31379 | [
"MIT"
] | null | null | null | """
Pygame setup for Some Platformer Game
Created by sheepy0125
08/10/2021
"""
import pygame
SCREEN_SIZE = (500, 500)
SCROLL_OFFSET = (SCREEN_SIZE[0] // 2, SCREEN_SIZE[1] // 2)
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption("Some Platformer Game")
clock = pygame.time.Clock()
| 21.714286 | 58 | 0.746711 |
import pygame
SCREEN_SIZE = (500, 500)
SCROLL_OFFSET = (SCREEN_SIZE[0] // 2, SCREEN_SIZE[1] // 2)
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption("Some Platformer Game")
clock = pygame.time.Clock()
| true | true |
f71b256176da366107fb45bcef939ee05c453375 | 13,883 | py | Python | nexmo/__init__.py | cook-health/messaging | 1a827b97d9af6e56d55c362b29dd79a6cb373f88 | [
"MIT"
] | null | null | null | nexmo/__init__.py | cook-health/messaging | 1a827b97d9af6e56d55c362b29dd79a6cb373f88 | [
"MIT"
] | 2 | 2018-03-14T10:42:37.000Z | 2018-03-14T11:01:31.000Z | nexmo/__init__.py | Seliniux777/Nexmo-nexmo-python | d1d60e8068b1cb23f12507a6ec1cd500285890b5 | [
"MIT"
] | 1 | 2020-10-18T09:41:15.000Z | 2020-10-18T09:41:15.000Z | from platform import python_version
import hashlib
import hmac
import jwt
import os
import requests
import sys
import time
from uuid import uuid4
import warnings
if sys.version_info[0] == 3:
string_types = (str, bytes)
else:
string_types = (unicode, str)
__version__ = '2.0.0'
class Error(Exception):
pa... | 38.457064 | 120 | 0.666859 | from platform import python_version
import hashlib
import hmac
import jwt
import os
import requests
import sys
import time
from uuid import uuid4
import warnings
if sys.version_info[0] == 3:
string_types = (str, bytes)
else:
string_types = (unicode, str)
__version__ = '2.0.0'
class Error(Exception):
pa... | true | true |
f71b26b2f58e18b2342f9b9601e14fbabdb77fb3 | 2,930 | py | Python | src/python/pants/util/process_handler.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/util/process_handler.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | src/python/pants/util/process_handler.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import io
import multiprocessing
import subprocess
import sys
from abc import ABC, abstractmethod
from typing import Optional
class ProcessHandler(ABC):
"""An abstraction of process ... | 29.897959 | 100 | 0.650853 |
import io
import multiprocessing
import subprocess
import sys
from abc import ABC, abstractmethod
from typing import Optional
class ProcessHandler(ABC):
@abstractmethod
def wait(self, timeout: Optional[float] = None) -> int:
@abstractmethod
def kill(self) -> None:
pass
@abstractmetho... | true | true |
f71b2735ba192a6cc12f568c018d29bbdfde9f83 | 3,035 | py | Python | code/evaluate_DSTC2.py | avinashsai/GCN-SeA | 26968d8a71269581f7400293064314b5a18b5748 | [
"Apache-2.0"
] | 12 | 2019-09-06T03:48:36.000Z | 2021-04-12T08:36:45.000Z | code/evaluate_DSTC2.py | avinashsai/GCN-SeA | 26968d8a71269581f7400293064314b5a18b5748 | [
"Apache-2.0"
] | null | null | null | code/evaluate_DSTC2.py | avinashsai/GCN-SeA | 26968d8a71269581f7400293064314b5a18b5748 | [
"Apache-2.0"
] | 9 | 2019-06-30T07:23:01.000Z | 2020-10-16T10:05:37.000Z | from metrics import bleu, rouge
import argparse
def get_args():
'''
Parse input arguments:
preds_path: The directory in which labels and predictions files are dumped after inference
config_id: The config id mentioned in the labels and predictions filenames
'''
parser = argparse.Argument... | 28.632075 | 235 | 0.559143 | from metrics import bleu, rouge
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--preds_path")
parser.add_argument("--kb_path")
parser.add_argument("--config_id")
args = parser.parse_args()
return args
def read_results(path,num):
with open(path+"/lab... | true | true |
f71b27f6c3b0d480c4f0a1707e1a22e41cb11bbd | 7,941 | py | Python | venv/lib/python3.8/site-packages/django/middleware/cache.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 1 | 2022-03-16T14:43:26.000Z | 2022-03-16T14:43:26.000Z | venv/lib/python3.8/site-packages/django/middleware/cache.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | null | null | null | venv/lib/python3.8/site-packages/django/middleware/cache.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 4 | 2022-03-12T10:17:00.000Z | 2022-03-26T08:40:43.000Z | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE = [
'django.middleware.cache.UpdateCacheMiddl... | 38.362319 | 86 | 0.673467 |
from django.conf import settings
from django.core.cache import DEFAULT_CACHE_ALIAS, caches
from django.utils.cache import (
get_cache_key,
get_max_age,
has_vary_header,
learn_cache_key,
patch_response_headers,
)
from django.utils.deprecation import MiddlewareMixin
class UpdateCacheMiddleware(Midd... | true | true |
f71b286c1207f4d6dae4a96c65379f266e26d4b1 | 7,686 | py | Python | newrelic/hooks/framework_grpc.py | odidev/newrelic-python-agent | e6c4ddc158ab694dd7ff6bd75e54077d736674f1 | [
"Apache-2.0"
] | null | null | null | newrelic/hooks/framework_grpc.py | odidev/newrelic-python-agent | e6c4ddc158ab694dd7ff6bd75e54077d736674f1 | [
"Apache-2.0"
] | null | null | null | newrelic/hooks/framework_grpc.py | odidev/newrelic-python-agent | e6c4ddc158ab694dd7ff6bd75e54077d736674f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 New Relic, Inc.
#
# 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 writ... | 33.710526 | 76 | 0.683971 |
import random
import time
from newrelic.api.external_trace import ExternalTrace
from newrelic.api.web_transaction import WebTransactionWrapper
from newrelic.api.transaction import current_transaction
from newrelic.api.time_trace import record_exception
from newrelic.common.object_wrapper import wrap_func... | true | true |
f71b28ebefb77cb9a3e1c49a1442eb967f6d40ea | 2,038 | py | Python | pytorch_lightning/plugins/training_type/sharded_spawn.py | peblair/pytorch-lightning | e676ff96b16224331297dbd0e5ecd5cf364965b8 | [
"Apache-2.0"
] | 1 | 2021-02-12T04:15:31.000Z | 2021-02-12T04:15:31.000Z | pytorch_lightning/plugins/training_type/sharded_spawn.py | peblair/pytorch-lightning | e676ff96b16224331297dbd0e5ecd5cf364965b8 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/plugins/training_type/sharded_spawn.py | peblair/pytorch-lightning | e676ff96b16224331297dbd0e5ecd5cf364965b8 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from pytorch_lightning.core.optimizer import is_lightning_optimizer
from pytorch_lightning.plugins.training_type.ddp_spawn import DDPSpawnPlugin
from pytorch_lightning.utilities import _FAIRSCALE_AVAILABLE, rank_zero_only
if _FAIRSCALE_AVAILABLE:
from fairscale.optim import OSS
fr... | 37.054545 | 108 | 0.707066 | from typing import Optional
from pytorch_lightning.core.optimizer import is_lightning_optimizer
from pytorch_lightning.plugins.training_type.ddp_spawn import DDPSpawnPlugin
from pytorch_lightning.utilities import _FAIRSCALE_AVAILABLE, rank_zero_only
if _FAIRSCALE_AVAILABLE:
from fairscale.optim import OSS
fr... | true | true |
f71b296b1a35ac64d40aa0c9ca07717a2e1e1b1b | 17,693 | py | Python | models/pages.py | tobiassernhede/multi_user_blog | c657c5dacdab7b04cf226f75a085e8ac5a1d54a2 | [
"MIT"
] | null | null | null | models/pages.py | tobiassernhede/multi_user_blog | c657c5dacdab7b04cf226f75a085e8ac5a1d54a2 | [
"MIT"
] | null | null | null | models/pages.py | tobiassernhede/multi_user_blog | c657c5dacdab7b04cf226f75a085e8ac5a1d54a2 | [
"MIT"
] | null | null | null | # Split up the pages functionality in separate file to make the code
# easier to read
import os
import re
import webapp2
import jinja2
import json
from google.appengine.ext import ndb
from google.appengine.api import images
# Importing local .py files
from models.users import User, users_key, make_secure_val, check_... | 33.50947 | 92 | 0.562652 |
import os
import re
import webapp2
import jinja2
import json
from google.appengine.ext import ndb
from google.appengine.api import images
from models.users import User, users_key, make_secure_val, check_secure_val
from models.posts import Post, blog_key
from models.comments import Comment, comment_key
from models... | true | true |
f71b2aad75e30594e61025ad33be2a2c17932235 | 2,792 | py | Python | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | 1 | 2022-03-07T12:18:00.000Z | 2022-03-07T12:18:00.000Z | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | """
Implementation of a network using an Encoder-Decoder architecture.
"""
import torch.nn as tnn
from torch import Tensor
from reinvent_models.link_invent.networks.decoder import Decoder
from reinvent_models.link_invent.networks.encoder import Encoder
class EncoderDecoder(tnn.Module):
"""
An e... | 42.30303 | 115 | 0.666189 |
import torch.nn as tnn
from torch import Tensor
from reinvent_models.link_invent.networks.decoder import Decoder
from reinvent_models.link_invent.networks.encoder import Encoder
class EncoderDecoder(tnn.Module):
def __init__(self, encoder_params: dict, decoder_params: dict):
super(EncoderDec... | true | true |
f71b2accb33c9e4fb30a401746d3041c3b953b26 | 11,528 | py | Python | second/mayank_scripts/infer_ros_melodic_pretained_same_frame.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | second/mayank_scripts/infer_ros_melodic_pretained_same_frame.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | second/mayank_scripts/infer_ros_melodic_pretained_same_frame.py | mayanks888/second.pytorch | 02d37885a543ee46516648dcab7db8f5d677a179 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# ROS node libs
import time
import numpy as np
import rospy
import torch
# from geometry_msgs.msg import Quaternion, Pose, Point, Vector3
from pyquaternion import Quaternion
from google.protobuf import text_format
from sensor_msgs.msg import PointCloud2
from std_msgs.msg import Header, ColorRGBA... | 45.207843 | 128 | 0.567661 |
import time
import numpy as np
import rospy
import torch
from pyquaternion import Quaternion
from google.protobuf import text_format
from sensor_msgs.msg import PointCloud2
from std_msgs.msg import Header, ColorRGBA
from visualization_msgs.msg import Marker, MarkerArray
from second.protos import pipeline_pb2
fr... | true | true |
f71b2b5262d128663739d9f88003925845a959b1 | 27,166 | py | Python | colour/corresponding/datasets/breneman1987.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | colour/corresponding/datasets/breneman1987.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | colour/corresponding/datasets/breneman1987.py | MaxSchambach/colour | 3f3685d616fda4be58cec20bc1e16194805d7e2d | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Breneman Corresponding Chromaticities Dataset
=============================================
Defines *Breneman (1987)* results for corresponding chromaticities experiments.
See Also
--------
`Corresponding Chromaticities Prediction Jupyter Notebook
<http://nbviewer.jupyter.org/github/colour... | 32.035377 | 79 | 0.536406 |
from __future__ import division, unicode_literals
import numpy as np
from collections import namedtuple
from colour.utilities.documentation import DocstringDict
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2019 - Colour Developers'
__license__ = 'New BSD License - https://opensource.org/li... | true | true |
f71b2b58505f1a73cc43c49801a8cae13c3f8a26 | 43 | py | Python | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | 1 | 2018-04-02T15:38:10.000Z | 2018-04-02T15:38:10.000Z | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | null | null | null | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | 1 | 2021-09-04T12:37:34.000Z | 2021-09-04T12:37:34.000Z | import state
def change():
state.x = 2 | 10.75 | 15 | 0.627907 | import state
def change():
state.x = 2 | true | true |
f71b2c8b5ead15b27ff28d5dc1c80528e9c46c18 | 2,755 | py | Python | profiler/torchmodules/torchlogger/activation_gradient_logger.py | NestLakerJasonLIN/pipedream | f50827f2e28cbdbd82a4ea686c0498272b1460d6 | [
"MIT"
] | 273 | 2019-08-31T14:12:11.000Z | 2022-03-05T13:34:25.000Z | profiler/torchmodules/torchlogger/activation_gradient_logger.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 67 | 2019-09-19T15:36:59.000Z | 2022-01-13T09:11:54.000Z | profiler/torchmodules/torchlogger/activation_gradient_logger.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 100 | 2019-09-16T20:59:14.000Z | 2022-03-23T12:56:56.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import pickle
import torch
class ActivationAndGradientLogger:
def __init__(self, directory):
self.directory = directory
try:
os.mkdir(self.directory)
except:
pass
self.iterat... | 34.873418 | 103 | 0.591652 |
import os
import pickle
import torch
class ActivationAndGradientLogger:
def __init__(self, directory):
self.directory = directory
try:
os.mkdir(self.directory)
except:
pass
self.iteration = 0
self.forward_counter = 0
self.backward_counter ... | true | true |
f71b2c90cb12b8290d45257d9a8169e55982187d | 4,207 | py | Python | twine/commands/check.py | chadwhawkins/twine | bd1d8b0f3ffdae9b91672d075d58cf635aa0e0f6 | [
"Apache-2.0"
] | null | null | null | twine/commands/check.py | chadwhawkins/twine | bd1d8b0f3ffdae9b91672d075d58cf635aa0e0f6 | [
"Apache-2.0"
] | null | null | null | twine/commands/check.py | chadwhawkins/twine | bd1d8b0f3ffdae9b91672d075d58cf635aa0e0f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Dustin Ingram
#
# 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 writing, so... | 32.114504 | 78 | 0.659853 |
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import argparse
import cgi
import re
import sys
try:
from StringIO import StringIO
except ImportError:
from _io import StringIO
import readme_renderer.markdown
import readme_renderer.rst
impo... | true | true |
f71b2d261e9d06c923fdc731f3a69eb747347726 | 11,627 | py | Python | bioactive_lab.py | PriyamvadaKumar/AWS_BioActive_Classification | b6a4413618586712ca4dc196f2dfaa3ceca804fb | [
"MIT"
] | 1 | 2021-06-04T02:46:37.000Z | 2021-06-04T02:46:37.000Z | bioactive_lab.py | PriyamvadaKumar/AWS_BioActive_classification | b6a4413618586712ca4dc196f2dfaa3ceca804fb | [
"MIT"
] | null | null | null | bioactive_lab.py | PriyamvadaKumar/AWS_BioActive_classification | b6a4413618586712ca4dc196f2dfaa3ceca804fb | [
"MIT"
] | null | null | null | import os, sys
dirpath = os.getcwd()
sys.path.insert(0, dirpath + '/goal_tether_functions')
sys.path.insert(0, dirpath + '/predictive_modelers')
sys.path.insert(0, dirpath + '/predictive_modelers/assessment_resources')
sys.path.insert(0, dirpath + '/active_learners')
sys.path.insert(0, dirpath + '/data_acquisition')
sy... | 32.387187 | 113 | 0.637224 | import os, sys
dirpath = os.getcwd()
sys.path.insert(0, dirpath + '/goal_tether_functions')
sys.path.insert(0, dirpath + '/predictive_modelers')
sys.path.insert(0, dirpath + '/predictive_modelers/assessment_resources')
sys.path.insert(0, dirpath + '/active_learners')
sys.path.insert(0, dirpath + '/data_acquisition')
sy... | true | true |
f71b2dd96ed4ebc42bacf10ebdd08e56bd022192 | 1,747 | py | Python | s3-bucket-cleaner/clean_s3_bucket.py | artsy/opstools | 889b08c6b741dfeac0c32b0a4d96d0f9f3bbc0e7 | [
"MIT"
] | null | null | null | s3-bucket-cleaner/clean_s3_bucket.py | artsy/opstools | 889b08c6b741dfeac0c32b0a4d96d0f9f3bbc0e7 | [
"MIT"
] | null | null | null | s3-bucket-cleaner/clean_s3_bucket.py | artsy/opstools | 889b08c6b741dfeac0c32b0a4d96d0f9f3bbc0e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Sourced from https://gist.github.com/seventhskye/0cc7b2804252975d36dca047ab7729e9 with some modifications
import os
import boto3
def main():
client = boto3.client('s3')
Bucket = os.environ.get('S3_BUCKET')
Prefix = os.environ.get('S3_PREFIX', '') # leave blank to delete the entire conte... | 28.639344 | 107 | 0.627934 |
import os
import boto3
def main():
client = boto3.client('s3')
Bucket = os.environ.get('S3_BUCKET')
Prefix = os.environ.get('S3_PREFIX', '')
IsTruncated = True
MaxKeys = 1000
KeyMarker = None
if Bucket is None:
print("Environment variable S3_BUCKET must be set!")
return
while IsTruncated... | true | true |
f71b2e2da61209cbca5bf4e3278259b97ab94ddd | 135 | py | Python | scripts/migrate_piwik/settings/local-dist.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | scripts/migrate_piwik/settings/local-dist.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | scripts/migrate_piwik/settings/local-dist.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | PIWIK_DB_HOST = 'localhost'
PIWIK_DB_PORT = 3336
PIWIK_DB_USER = 'root'
PIWIK_DB_PASSWORD = 'changeme'
PIWIK_DB_NAME = 'piwik_staging'
| 22.5 | 31 | 0.792593 | PIWIK_DB_HOST = 'localhost'
PIWIK_DB_PORT = 3336
PIWIK_DB_USER = 'root'
PIWIK_DB_PASSWORD = 'changeme'
PIWIK_DB_NAME = 'piwik_staging'
| true | true |
f71b2e305d3d87fbaf19ce272d3f1ec378c3ef49 | 1,017 | py | Python | tenants/monkey/db/migrations/recorder.py | bugkiwi/django-tenants-mysql | bc008bde01f5dbbd0e85bcacfa48db2ee8347e50 | [
"MIT"
] | 2 | 2017-08-01T10:29:00.000Z | 2022-03-05T12:51:43.000Z | tenants/monkey/db/migrations/recorder.py | bugkiwi/django-tenants-mysql | bc008bde01f5dbbd0e85bcacfa48db2ee8347e50 | [
"MIT"
] | 1 | 2018-08-07T13:40:38.000Z | 2018-08-07T13:40:38.000Z | tenants/monkey/db/migrations/recorder.py | bugkiwi/django-tenants-mysql | bc008bde01f5dbbd0e85bcacfa48db2ee8347e50 | [
"MIT"
] | 2 | 2019-11-27T09:34:44.000Z | 2022-03-05T12:59:12.000Z | #!/usr/bin/env python
#coding:utf-8
__author__ = 'gkiwi'
from django.db.utils import DatabaseError
from django.db.migrations.exceptions import MigrationSchemaMissing
__all__ = ['MigrationRecorder']
class MigrationRecorder(object):
def ensure_schema(self):
"""
Ensures the table exists and has th... | 31.78125 | 99 | 0.665683 |
__author__ = 'gkiwi'
from django.db.utils import DatabaseError
from django.db.migrations.exceptions import MigrationSchemaMissing
__all__ = ['MigrationRecorder']
class MigrationRecorder(object):
def ensure_schema(self):
# in the codebase.
# gkiwi #TOPATCH
from django.db impor... | true | true |
f71b2e92c0252192242ac618201c720c01142e52 | 46,863 | py | Python | pyAudioAnalysis/audioSegmentation.py | polewczakp/pyAudioAnalysis | 7dc2d8e18da1ca2f2485a402bb7399b43bbb2b24 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/audioSegmentation.py | polewczakp/pyAudioAnalysis | 7dc2d8e18da1ca2f2485a402bb7399b43bbb2b24 | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/audioSegmentation.py | polewczakp/pyAudioAnalysis | 7dc2d8e18da1ca2f2485a402bb7399b43bbb2b24 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import csv
import glob
import scipy
import sklearn
import numpy as np
import hmmlearn.hmm
import sklearn.cluster
import pickle as cpickle
import matplotlib.pyplot as plt
from scipy.spatial import distance
import sklearn.discriminant_analysis
from pyAudioAnalysis import au... | 39.714407 | 83 | 0.598959 | from __future__ import print_function
import os
import csv
import glob
import scipy
import sklearn
import numpy as np
import hmmlearn.hmm
import sklearn.cluster
import pickle as cpickle
import matplotlib.pyplot as plt
from scipy.spatial import distance
import sklearn.discriminant_analysis
from pyAudioAnalysis import au... | true | true |
f71b2ed9253b60e916abe7efa50cc6715f2d213c | 2,044 | py | Python | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 3 | 2020-02-12T01:24:46.000Z | 2020-02-13T00:50:46.000Z | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 32 | 2020-02-20T10:20:56.000Z | 2022-02-10T01:42:46.000Z | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 1 | 2020-02-22T02:47:19.000Z | 2020-02-22T02:47:19.000Z | #!/usr/bin/env python3
import unittest
from src.crawler.iCrawler import iCrawler, UndefinedDatabaseException
from src.data.MetaDataItem import MetaDataItem
from test.mock.MockDataAccessor import MockDataAccessor
class MockCrawler(iCrawler):
def __init__(self):
super().__init__()
def next_downloadabl... | 29.623188 | 86 | 0.675147 |
import unittest
from src.crawler.iCrawler import iCrawler, UndefinedDatabaseException
from src.data.MetaDataItem import MetaDataItem
from test.mock.MockDataAccessor import MockDataAccessor
class MockCrawler(iCrawler):
def __init__(self):
super().__init__()
def next_downloadable(self):
retur... | true | true |
f71b2f0c6d371df241e52fd406f5828a49387ea4 | 4,395 | py | Python | prepare.py | binmahone/Raven | 40b7e24f14a72af978341c311250f15795be1eb0 | [
"Apache-2.0"
] | 1 | 2021-12-23T02:45:06.000Z | 2021-12-23T02:45:06.000Z | prepare.py | Mukvin/Raven | 40b7e24f14a72af978341c311250f15795be1eb0 | [
"Apache-2.0"
] | null | null | null | prepare.py | Mukvin/Raven | 40b7e24f14a72af978341c311250f15795be1eb0 | [
"Apache-2.0"
] | 2 | 2021-09-16T10:18:01.000Z | 2021-09-17T08:40:47.000Z | import time
import boto3
from lib.Logger import Logger
from lib.popen import subprocess_popen
def prepare():
# 0. Initialize boto3 clients
emr = boto3.client('emr')
ec2 = boto3.client('ec2')
# 1. Create an EMR cluster on AWS
logger.info("Creating the EMR cluster...")
with open("./cloud/cluste... | 46.755319 | 119 | 0.513311 | import time
import boto3
from lib.Logger import Logger
from lib.popen import subprocess_popen
def prepare():
emr = boto3.client('emr')
ec2 = boto3.client('ec2')
logger.info("Creating the EMR cluster...")
with open("./cloud/cluster.sh", 'r') as f:
cmd = f.read()
res = subproc... | true | true |
f71b2fb9a2d9df9315262d217475ffce3958a2f8 | 9,376 | py | Python | src/snowflake/connector/auth_okta.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 3 | 2021-03-05T22:01:00.000Z | 2021-04-02T17:48:33.000Z | src/snowflake/connector/auth_okta.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 26 | 2021-06-01T09:43:42.000Z | 2022-03-16T15:11:52.000Z | src/snowflake/connector/auth_okta.py | groodt/snowflake-connector-python | 26d0a36cb9a65a728e745f077bd11ab536d386f8 | [
"Apache-2.0"
] | 1 | 2021-03-05T22:08:46.000Z | 2021-03-05T22:08:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2020 Snowflake Computing Inc. All right reserved.
#
import json
import logging
from .auth import Auth
from .auth_by_plugin import AuthByPlugin
from .compat import unescape, urlencode, urlsplit
from .constants import HTTP_HEADER_ACCEPT, HTTP_HEADER_C... | 39.561181 | 117 | 0.611455 |
import json
import logging
from .auth import Auth
from .auth_by_plugin import AuthByPlugin
from .compat import unescape, urlencode, urlsplit
from .constants import HTTP_HEADER_ACCEPT, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_SERVICE_NAME, HTTP_HEADER_USER_AGENT
from .errorcode import ER_IDP_CONNECTION_ERROR, ER_INC... | true | true |
f71b2fcfe4e1bf00db7f8c9aa8bc9eac22fc3f1c | 2,248 | py | Python | mobile/db/prompts.py | TRIP-Lab/itinerum-mobile-api | a3b31b411d9d46434c54be1d21415024dec86ae7 | [
"MIT"
] | 4 | 2019-02-04T15:34:49.000Z | 2021-04-30T17:33:05.000Z | mobile/db/prompts.py | TRIP-Lab/itinerum-mobile-api | a3b31b411d9d46434c54be1d21415024dec86ae7 | [
"MIT"
] | 1 | 2021-03-19T22:26:11.000Z | 2021-03-19T22:26:11.000Z | mobile/db/prompts.py | TRIP-Lab/itinerum-mobile-api | a3b31b411d9d46434c54be1d21415024dec86ae7 | [
"MIT"
] | 5 | 2018-03-13T20:24:55.000Z | 2021-01-18T14:44:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Kyle Fitzsimmons, 2017
from datetime import datetime
import pytz
from models import db, PromptResponse
class MobilePromptsActions:
def get(self, prompts_uuids):
prompts_filters = PromptResponse.prompt_uuid.in_(prompts_uuids)
return db.session.query... | 36.852459 | 71 | 0.589858 |
from datetime import datetime
import pytz
from models import db, PromptResponse
class MobilePromptsActions:
def get(self, prompts_uuids):
prompts_filters = PromptResponse.prompt_uuid.in_(prompts_uuids)
return db.session.query(PromptResponse).filter(prompts_filters)
def create_... | true | true |
f71b2fd793a7e41ee094ac47d7408dbb3c13f221 | 804 | py | Python | garf_data.py | doesnotsitproperly/garfbot | 04e2a8409bd171ca29b6cdb5e864fe2fa1c13b6d | [
"Unlicense"
] | null | null | null | garf_data.py | doesnotsitproperly/garfbot | 04e2a8409bd171ca29b6cdb5e864fe2fa1c13b6d | [
"Unlicense"
] | null | null | null | garf_data.py | doesnotsitproperly/garfbot | 04e2a8409bd171ca29b6cdb5e864fe2fa1c13b6d | [
"Unlicense"
] | null | null | null | import json, os
class GarfData:
file = os.path.join(os.getcwd(), "garf_data.json")
token: str
path_to_ffmpeg: str
jokes: list
trigger_words: list
def __init__(self):
with open(self.file, "r") as f:
json_dict = json.loads(f.read())
self.token = json_dict["token"]
... | 27.724138 | 67 | 0.584577 | import json, os
class GarfData:
file = os.path.join(os.getcwd(), "garf_data.json")
token: str
path_to_ffmpeg: str
jokes: list
trigger_words: list
def __init__(self):
with open(self.file, "r") as f:
json_dict = json.loads(f.read())
self.token = json_dict["token"]
... | true | true |
f71b2fde98fb40c654242c9096ab88064334974c | 33,682 | py | Python | models/adaptation_model_stage1.py | BwCai/DCAA-UDA | 359c2122060aebfbe4384c918768c261fe2dc9c7 | [
"Apache-2.0"
] | 2 | 2022-01-28T10:35:53.000Z | 2022-03-09T14:38:59.000Z | models/adaptation_model_stage1.py | BwCai/DCAA-UDA | 359c2122060aebfbe4384c918768c261fe2dc9c7 | [
"Apache-2.0"
] | 1 | 2022-03-07T10:48:11.000Z | 2022-03-07T10:48:11.000Z | models/adaptation_model_stage1.py | BwCai/DCAA-UDA | 359c2122060aebfbe4384c918768c261fe2dc9c7 | [
"Apache-2.0"
] | null | null | null | from models.base_model import BaseModel
import torch.nn as nn
import torch.nn.functional as F
import os, sys
import torch
import numpy as np
import itertools
from torch.autograd import Variable
from optimizers import get_optimizer
from schedulers import get_scheduler
from models.sync_batchnorm import SynchronizedBatch... | 43.293059 | 173 | 0.598064 | from models.base_model import BaseModel
import torch.nn as nn
import torch.nn.functional as F
import os, sys
import torch
import numpy as np
import itertools
from torch.autograd import Variable
from optimizers import get_optimizer
from schedulers import get_scheduler
from models.sync_batchnorm import SynchronizedBatch... | true | true |
f71b30ea10a42f00072f8fb902d4bdeca0fdac2c | 4,663 | py | Python | pose_sync_pytorch/generate_basic.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | null | null | null | pose_sync_pytorch/generate_basic.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | null | null | null | pose_sync_pytorch/generate_basic.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | null | null | null | import os
from moviepy.editor import VideoFileClip, concatenate_videoclips
import random
import numpy as np
import time
# from video_facial_landmarks_minmax import calculate_distance
from video_pose_landmarks import calculate_pose_distance
TEST = True
TEST_TIME = 20
INIT_NUM = float("Inf")
WINDOW_TIME = 10
PADDED_TIME... | 36.716535 | 118 | 0.619558 | import os
from moviepy.editor import VideoFileClip, concatenate_videoclips
import random
import numpy as np
import time
from video_pose_landmarks import calculate_pose_distance
TEST = True
TEST_TIME = 20
INIT_NUM = float("Inf")
WINDOW_TIME = 10
PADDED_TIME = 4
def pose_distance(reference_clip, clip):
m... | true | true |
f71b30f5180889ca3dd9df9574f878409863dfe6 | 1,003 | py | Python | Tests/test_TimeAverager.py | chipgarner/yourair | 22415389256cfa283e817970d6c79c187cbded4c | [
"MIT"
] | null | null | null | Tests/test_TimeAverager.py | chipgarner/yourair | 22415389256cfa283e817970d6c79c187cbded4c | [
"MIT"
] | null | null | null | Tests/test_TimeAverager.py | chipgarner/yourair | 22415389256cfa283e817970d6c79c187cbded4c | [
"MIT"
] | null | null | null | import Averager as Avg
class Average:
def __init__(self):
self.answer = 0
self.delta_time = 0
def average(self, avg, delta_t):
print("Average: " + str(avg) + " Timespan: " + str(delta_t))
self.answer = avg
self.delta_time = delta_t
def test_averager():
avg = Aver... | 20.469388 | 68 | 0.639083 | import Averager as Avg
class Average:
def __init__(self):
self.answer = 0
self.delta_time = 0
def average(self, avg, delta_t):
print("Average: " + str(avg) + " Timespan: " + str(delta_t))
self.answer = avg
self.delta_time = delta_t
def test_averager():
avg = Aver... | true | true |
f71b315d6312d73a4f7581bd22785f23c8cb7785 | 5,935 | py | Python | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | dstoup/kwiver | a3a36317b446baf0feb6274235ab1ac6b4329ead | [
"BSD-3-Clause"
] | 1 | 2017-07-31T07:07:32.000Z | 2017-07-31T07:07:32.000Z | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | dstoup/kwiver | a3a36317b446baf0feb6274235ab1ac6b4329ead | [
"BSD-3-Clause"
] | 3 | 2021-03-19T15:39:43.000Z | 2021-09-08T02:47:15.000Z | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | acidburn0zzz/kwiver | 6e4205f1c46df04759c57c040f01cc804b27e00d | [
"BSD-3-Clause"
] | null | null | null | #!@PYTHON_EXECUTABLE@
#ckwg +28
# Copyright 2011-2013 by Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,... | 29.824121 | 85 | 0.694356 |
def test_import():
try:
from sprokit.pipeline import config
import sprokit.pipeline.scheduler_factory
except:
test_error("Failed to import the scheduler_factory module")
def test_create():
from sprokit.pipeline import config
from sprokit.pipeline ... | true | true |
f71b32a53e1eb2f384ead41803a3f5892542c5b5 | 6,308 | py | Python | dbms/tests/queries/0_stateless/helpers/uexpect.py | sunadm/ClickHouse | 55903fbe23ef6dff8fc7ec25ae68e04919bc9b7f | [
"Apache-2.0"
] | 8 | 2019-06-04T02:50:13.000Z | 2022-02-10T06:46:51.000Z | dbms/tests/queries/0_stateless/helpers/uexpect.py | sunadm/ClickHouse | 55903fbe23ef6dff8fc7ec25ae68e04919bc9b7f | [
"Apache-2.0"
] | 16 | 2021-06-07T21:32:30.000Z | 2022-03-31T21:08:29.000Z | dbms/tests/queries/0_stateless/helpers/uexpect.py | sunadm/ClickHouse | 55903fbe23ef6dff8fc7ec25ae68e04919bc9b7f | [
"Apache-2.0"
] | 3 | 2020-02-24T12:57:54.000Z | 2021-10-04T13:29:00.000Z | # Copyright (c) 2019 Vitaliy Zakaznikov
#
# 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 i... | 30.47343 | 102 | 0.566265 |
import os
import pty
import time
import sys
import re
from threading import Thread, Event
from subprocess import Popen
from Queue import Queue, Empty
class TimeoutError(Exception):
def __init__(self, timeout):
self.timeout = timeout
def __str__(self):
return 'Timeout %.3fs' % flo... | true | true |
f71b32db7390644ae31d4b98d84b70883c847091 | 1,777 | py | Python | generate/uk.py | mczub/because-moe | d57164399832e32f505a081d7196e0f3828a6e35 | [
"Unlicense",
"MIT"
] | 78 | 2015-09-09T00:48:19.000Z | 2022-02-25T14:18:46.000Z | generate/uk.py | mczub/because-moe | d57164399832e32f505a081d7196e0f3828a6e35 | [
"Unlicense",
"MIT"
] | 15 | 2015-09-09T03:56:29.000Z | 2020-01-03T07:18:50.000Z | generate/uk.py | mczub/because-moe | d57164399832e32f505a081d7196e0f3828a6e35 | [
"Unlicense",
"MIT"
] | 22 | 2015-09-09T03:05:37.000Z | 2021-07-24T07:35:59.000Z | import sys
sys.path.append("site-packages")
import json
import string
from unidecode import unidecode
from urllib import parse
from azure.storage.blob import BlockBlobService
from datetime import datetime
import animesources
indexedShows = {}
shows = []
with open('title-map.json') as titlemap_file:
titlemap = json.l... | 34.843137 | 106 | 0.758582 | import sys
sys.path.append("site-packages")
import json
import string
from unidecode import unidecode
from urllib import parse
from azure.storage.blob import BlockBlobService
from datetime import datetime
import animesources
indexedShows = {}
shows = []
with open('title-map.json') as titlemap_file:
titlemap = json.l... | true | true |
f71b33566c8e0a884e4d1704ac06c8583ef46398 | 7,939 | py | Python | tests/test_storage.py | gregdan3/limits | f2c693b9009afe27c9ecbb94492455ad470127f1 | [
"MIT"
] | null | null | null | tests/test_storage.py | gregdan3/limits | f2c693b9009afe27c9ecbb94492455ad470127f1 | [
"MIT"
] | null | null | null | tests/test_storage.py | gregdan3/limits | f2c693b9009afe27c9ecbb94492455ad470127f1 | [
"MIT"
] | null | null | null | import time
import pytest
from limits.errors import ConfigurationError
from limits.storage import (
MemcachedStorage,
MemoryStorage,
MongoDBStorage,
RedisClusterStorage,
RedisSentinelStorage,
RedisStorage,
Storage,
storage_from_string,
)
from limits.strategies import MovingWindowRateLi... | 32.272358 | 84 | 0.493513 | import time
import pytest
from limits.errors import ConfigurationError
from limits.storage import (
MemcachedStorage,
MemoryStorage,
MongoDBStorage,
RedisClusterStorage,
RedisSentinelStorage,
RedisStorage,
Storage,
storage_from_string,
)
from limits.strategies import MovingWindowRateLi... | true | true |
f71b336c74bf785c71596fc3f4e1c0603495a240 | 37,268 | py | Python | desktop/libs/indexer/src/indexer/indexers/sql_tests.py | taklwu/hue | db661408f8fd206557b3d98670cf5edc4d52f869 | [
"Apache-2.0"
] | 1 | 2020-06-22T10:20:52.000Z | 2020-06-22T10:20:52.000Z | desktop/libs/indexer/src/indexer/indexers/sql_tests.py | taklwu/hue | db661408f8fd206557b3d98670cf5edc4d52f869 | [
"Apache-2.0"
] | null | null | null | desktop/libs/indexer/src/indexer/indexers/sql_tests.py | taklwu/hue | db661408f8fd206557b3d98670cf5edc4d52f869 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (... | 165.635556 | 7,415 | 0.674305 |
from builtins import object
import json
from mock import patch, Mock, MagicMock
from nose.tools import assert_equal, assert_true
from desktop.lib.django_test_util import make_logged_in_client
from useradmin.models import User
from indexer.indexers.sql import SQLIndexer
class MockRequest(object):
... | true | true |
f71b3428812e3f4af3ba5ec76b4fec00628e68ec | 1,009 | py | Python | web/tex_cnn_rest.py | wbj0110/cnn-text-classification-tf-chinese | 42e47d34c300e9d571231e43c189ee292b595559 | [
"Apache-2.0"
] | null | null | null | web/tex_cnn_rest.py | wbj0110/cnn-text-classification-tf-chinese | 42e47d34c300e9d571231e43c189ee292b595559 | [
"Apache-2.0"
] | null | null | null | web/tex_cnn_rest.py | wbj0110/cnn-text-classification-tf-chinese | 42e47d34c300e9d571231e43c189ee292b595559 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
from tornado import httpserver
from tornado import gen
from tornado.ioloop import IOLoop
import tornado.web
import json
import single_eval as sev
class IndexHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello,This is TextCNN")
class ClassifyHandler(tornado.... | 25.871795 | 100 | 0.667988 |
from tornado import httpserver
from tornado import gen
from tornado.ioloop import IOLoop
import tornado.web
import json
import single_eval as sev
class IndexHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello,This is TextCNN")
class ClassifyHandler(tornado.web.RequestHandler):
... | true | true |
f71b345986d63817e8ebf1e91022534a55821bb0 | 1,010 | py | Python | setup.py | jiad-dev/flask-req-parser | f46a6c002381d7b74e9c80c6b3ae536dcda908f9 | [
"BSD-2-Clause"
] | 2 | 2020-10-17T04:46:08.000Z | 2020-10-17T04:46:10.000Z | setup.py | jiad-dev/flask-req-parser | f46a6c002381d7b74e9c80c6b3ae536dcda908f9 | [
"BSD-2-Clause"
] | null | null | null | setup.py | jiad-dev/flask-req-parser | f46a6c002381d7b74e9c80c6b3ae536dcda908f9 | [
"BSD-2-Clause"
] | 2 | 2020-10-07T03:33:19.000Z | 2020-10-07T04:07:16.000Z | from setuptools import setup
setup(
name='flask_req_parser',
version='0.1.4',
url='https://github.com/Rhyanz46/flask-req-parser',
license='BSD',
author='Arian Saputra',
author_email='rianariansaputra@gmail.com',
description='Simple Request parser for flask',
long_description=__doc__,
... | 30.606061 | 70 | 0.643564 | from setuptools import setup
setup(
name='flask_req_parser',
version='0.1.4',
url='https://github.com/Rhyanz46/flask-req-parser',
license='BSD',
author='Arian Saputra',
author_email='rianariansaputra@gmail.com',
description='Simple Request parser for flask',
long_description=__doc__,
... | true | true |
f71b36d9600e32803a5a8daae7b744b0672e4fd7 | 24,960 | py | Python | src/data/database.py | aFoxPod/torrent-bot | 29ffaea5edab81bfa3aa0d944a96a766d06770e5 | [
"MIT"
] | null | null | null | src/data/database.py | aFoxPod/torrent-bot | 29ffaea5edab81bfa3aa0d944a96a766d06770e5 | [
"MIT"
] | null | null | null | src/data/database.py | aFoxPod/torrent-bot | 29ffaea5edab81bfa3aa0d944a96a766d06770e5 | [
"MIT"
] | null | null | null | import sqlite3
class TorrentState:
SEARCHING = "SEARCHING" # Still being searched
DOWNLOADING = "DOWNLOADING" # Currently being downloading
SEEDING = "SEEDING" # Currently uploading
COMPLETED = "COMPLETED" # Removed from seeding
DELETING = "DELETING" # Torrent marked for deletion
PAUSED =... | 33.28 | 124 | 0.575561 | import sqlite3
class TorrentState:
SEARCHING = "SEARCHING"
DOWNLOADING = "DOWNLOADING"
SEEDING = "SEEDING"
COMPLETED = "COMPLETED"
DELETING = "DELETING"
PAUSED = "PAUSED"
@staticmethod
def get_states() -> list:
return [
TorrentState.SEARCHING,
... | true | true |
f71b389bb26a910057e54795c0cf91314386c30f | 11,436 | py | Python | sparseConv/multitask/semseg/models/res16unet.py | ShengyuH/Scene-Recognition-in-3D | 8fb869e1f8e8ff48c6f1082bb75f60a562875fc5 | [
"MIT"
] | 48 | 2020-03-02T23:05:59.000Z | 2022-02-22T11:23:17.000Z | sparseConv/multitask/semseg/models/res16unet.py | HenrryBryant/Scene-Recognition-in-3D | 8fb869e1f8e8ff48c6f1082bb75f60a562875fc5 | [
"MIT"
] | 5 | 2020-10-29T14:19:04.000Z | 2022-01-25T05:33:59.000Z | sparseConv/multitask/semseg/models/res16unet.py | HenrryBryant/Scene-Recognition-in-3D | 8fb869e1f8e8ff48c6f1082bb75f60a562875fc5 | [
"MIT"
] | 7 | 2020-06-18T05:23:01.000Z | 2021-05-13T01:26:32.000Z | from models.resnet import ResNetBase, get_norm
from models.modules.common import ConvType, NormType, conv, conv_tr
from models.modules.resnet_block import BasicBlock, Bottleneck, BasicBlockIN, BottleneckIN, BasicBlockLN
from MinkowskiEngine import MinkowskiReLU
import MinkowskiEngine.MinkowskiOps as me
class Res16UN... | 26.411085 | 104 | 0.669902 | from models.resnet import ResNetBase, get_norm
from models.modules.common import ConvType, NormType, conv, conv_tr
from models.modules.resnet_block import BasicBlock, Bottleneck, BasicBlockIN, BottleneckIN, BasicBlockLN
from MinkowskiEngine import MinkowskiReLU
import MinkowskiEngine.MinkowskiOps as me
class Res16UN... | true | true |
f71b38a82f278340c42a84945a9e9d87c7755673 | 5,609 | py | Python | pinyinsplit.py | throput/pinyinsplit | e500da5b4b37e4d7762790825e1efd1e6e0f4765 | [
"MIT"
] | 5 | 2018-11-12T19:33:37.000Z | 2021-05-26T05:03:48.000Z | pinyinsplit.py | throput/pinyinsplit | e500da5b4b37e4d7762790825e1efd1e6e0f4765 | [
"MIT"
] | null | null | null | pinyinsplit.py | throput/pinyinsplit | e500da5b4b37e4d7762790825e1efd1e6e0f4765 | [
"MIT"
] | 1 | 2021-08-10T07:15:18.000Z | 2021-08-10T07:15:18.000Z | from pygtrie import CharTrie
import copy
"""
Split a Chinese Pinyin phrase into a list of possible permutations of Pinyin words.This is the "example" module.
For example,
>>> from pinyinsplit import PinyinSplit
>>> pys = PinyinSplit()
>>> pys.split('XiangGangDaXue')
[['Xiang', 'Gang', 'Da', 'Xue'], ['Xiang', 'Gang',... | 50.080357 | 192 | 0.456409 | from pygtrie import CharTrie
import copy
class PinyinSplit:
pylist = [
'a', 'ai', 'an', 'ang', 'ao',
'ba', 'bai', 'ban', 'bang', 'bao', 'bei', 'ben', 'beng',
'bi', 'bian', 'biang', 'biao', 'bie', 'bin', 'bing', 'bo', 'bu',
'ca', 'cai', 'can', 'cang', 'cao', 'ce', 'cen', 'ceng',
... | true | true |
f71b39087446ecc9cc6e057576d78b80e52404ee | 340 | py | Python | src/chenv/__init__.py | jonathan-shemer/chenv | e2b86b7a53031a35def1be21ece87a05d74d2919 | [
"MIT"
] | 3 | 2020-10-15T07:46:48.000Z | 2021-09-06T20:49:05.000Z | src/chenv/__init__.py | jonathan-shemer/chenv | e2b86b7a53031a35def1be21ece87a05d74d2919 | [
"MIT"
] | 5 | 2021-01-27T11:47:12.000Z | 2021-08-30T08:49:37.000Z | src/chenv/__init__.py | jonathan-shemer/chenv | e2b86b7a53031a35def1be21ece87a05d74d2919 | [
"MIT"
] | 1 | 2022-03-15T09:29:19.000Z | 2022-03-15T09:29:19.000Z | """chenv."""
try:
from importlib.metadata import version, PackageNotFoundError # type: ignore
except ImportError: # pragma: no cover
from importlib_metadata import version, PackageNotFoundError # type: ignore
try:
__version__ = version(__name__)
except PackageNotFoundError: # pragma: no cover
__ve... | 28.333333 | 80 | 0.744118 | try:
from importlib.metadata import version, PackageNotFoundError
except ImportError:
from importlib_metadata import version, PackageNotFoundError
try:
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = "unknown"
| true | true |
f71b39d53d82554ce904392600c340709e0534bb | 2,018 | py | Python | pandas/tests/indexing/multiindex/test_chaining_and_caching.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-07T04:58:36.000Z | 2021-05-07T04:58:59.000Z | pandas/tests/indexing/multiindex/test_chaining_and_caching.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexing/multiindex/test_chaining_and_caching.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-06-16T07:19:12.000Z | 2021-12-16T10:24:44.000Z | import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
)
import pandas._testing as tm
import pandas.core.common as com
def test_detect_chained_assignment():
# Inplace ops, originally from:
# https://stackoverflow.com/questions/20508968/series-fillna-in-a-multiindex-d... | 28.422535 | 118 | 0.606541 | import numpy as np
import pytest
from pandas import (
DataFrame,
MultiIndex,
Series,
)
import pandas._testing as tm
import pandas.core.common as com
def test_detect_chained_assignment():
a = [12, 23]
b = [123, None]
c = [1234, 2345]
d = [12345, 23456]
tuples = [("eyes", "lef... | true | true |
f71b3ac0d45395a6a7e2ff0955877634c8665bca | 3,872 | py | Python | gym-kinova-gripper/plotting_code/other_plots.py | OSUrobotics/KinovaGrasping | f22af60d3683fdc4ffecf49ccff179fbc6750748 | [
"Linux-OpenIB"
] | 16 | 2020-05-16T00:40:31.000Z | 2022-02-22T11:59:03.000Z | gym-kinova-gripper/plotting_code/other_plots.py | OSUrobotics/KinovaGrasping | f22af60d3683fdc4ffecf49ccff179fbc6750748 | [
"Linux-OpenIB"
] | 9 | 2020-08-10T08:33:55.000Z | 2021-08-17T02:10:50.000Z | gym-kinova-gripper/plotting_code/other_plots.py | OSUrobotics/KinovaGrasping | f22af60d3683fdc4ffecf49ccff179fbc6750748 | [
"Linux-OpenIB"
] | 7 | 2020-07-27T09:45:05.000Z | 2021-06-21T21:42:50.000Z | import matplotlib.pyplot as plt
import numpy as np
## Extra plotting functions that can be called for quick analysis
def plot_timestep_distribution(success_timesteps=None, fail_timesteps=None, all_timesteps=None, expert_saving_dir=None):
""" Plot the distribution of time steps over successful and failed episodes ... | 46.650602 | 143 | 0.698089 | import matplotlib.pyplot as plt
import numpy as np
mesteps=None, all_timesteps=None, expert_saving_dir=None):
if all_timesteps is None:
success_timesteps = np.load(expert_saving_dir + "/success_timesteps.npy")
fail_timesteps = np.load(expert_saving_dir + "/fail_timesteps.npy")
all_timesteps... | true | true |
f71b3b475439ea9ed08d69fbc7b9ab409bb33d5a | 2,223 | py | Python | src/utils.py | wenyuC94/LogConcComp | b17d6ba6a102ba83a8415774b0e6da27a362bd5d | [
"MIT"
] | null | null | null | src/utils.py | wenyuC94/LogConcComp | b17d6ba6a102ba83a8415774b0e6da27a362bd5d | [
"MIT"
] | null | null | null | src/utils.py | wenyuC94/LogConcComp | b17d6ba6a102ba83a8415774b0e6da27a362bd5d | [
"MIT"
] | null | null | null | import os
import numpy as np
import numba as nb
def create_folder(storage_path):
if not os.path.isdir(storage_path):
os.makedirs(storage_path,exist_ok=True)
lsdir = os.listdir(storage_path)
for item in ["info","hist","soln","figs"]:
if item not in lsdir:
os.makedirs(storage_pat... | 28.5 | 78 | 0.559154 | import os
import numpy as np
import numba as nb
def create_folder(storage_path):
if not os.path.isdir(storage_path):
os.makedirs(storage_path,exist_ok=True)
lsdir = os.listdir(storage_path)
for item in ["info","hist","soln","figs"]:
if item not in lsdir:
os.makedirs(storage_pat... | true | true |
f71b3b5ffd9a0d39ef3e2a5f01e2965d34e8b74e | 1,448 | py | Python | make_string_alphabetic.py | Maffey/FunPythonScripts | 7682ab1f8dc7924eb4b3fb19d58ebbabe3901a22 | [
"Apache-2.0"
] | 1 | 2022-01-29T21:07:38.000Z | 2022-01-29T21:07:38.000Z | make_string_alphabetic.py | Maffey/fun-python-scripts | 7682ab1f8dc7924eb4b3fb19d58ebbabe3901a22 | [
"Apache-2.0"
] | 2 | 2019-05-15T13:48:58.000Z | 2019-05-29T18:33:34.000Z | make_string_alphabetic.py | Maffey/FunPythonScripts | 7682ab1f8dc7924eb4b3fb19d58ebbabe3901a22 | [
"Apache-2.0"
] | 1 | 2020-08-04T11:09:17.000Z | 2020-08-04T11:09:17.000Z | #! python
# Removes letter from word to make characters go alphabetically.
# It doesn't work all the time, but is efficient.
import unittest
class TestRemoveLettersAlphabet(unittest.TestCase):
def test_object1(self):
self.assertEqual(letters_to_remove('mateusz'), 3)
def test_object2(self):
s... | 27.320755 | 64 | 0.685083 |
import unittest
class TestRemoveLettersAlphabet(unittest.TestCase):
def test_object1(self):
self.assertEqual(letters_to_remove('mateusz'), 3)
def test_object2(self):
self.assertEqual(letters_to_remove('cba'), 2)
def test_object3(self):
self.assertEqual(letters_to_remove('dirt... | true | true |
f71b3ba93636d762ed00bb7c81089b7edadd08c2 | 1,407 | py | Python | verifiers/statusCode.py | CalConnect/caldavtester | a17683554df8a9b80fceab91085de99945fefe48 | [
"Apache-2.0"
] | 2 | 2019-04-23T04:06:08.000Z | 2020-08-26T17:30:45.000Z | verifiers/statusCode.py | CalConnect/caldavtester | a17683554df8a9b80fceab91085de99945fefe48 | [
"Apache-2.0"
] | 3 | 2017-09-28T13:23:39.000Z | 2017-10-03T15:59:36.000Z | verifiers/statusCode.py | CalConnect/caldavtester | a17683554df8a9b80fceab91085de99945fefe48 | [
"Apache-2.0"
] | 2 | 2017-02-08T04:47:31.000Z | 2021-08-05T20:09:10.000Z | ##
# Copyright (c) 2006-2016 Apple Inc. 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 l... | 34.317073 | 120 | 0.628998 |
class Verifier(object):
def verify(self, manager, uri, response, respdata, args):
teststatus = args.get("status", ["2xx"])
for test in teststatus:
if test[1:3] == "xx":
test = int(test[0])
else:
test = int(test)
... | true | true |
f71b3d10ad093122f20e0962b3f6645057d8279b | 613 | py | Python | classifier_stgcn_real_only/utils/temp.py | 1suancaiyu/STEP | 54195112990feaee137f5137775c736d07c2d26f | [
"MIT"
] | 32 | 2020-02-21T16:12:13.000Z | 2022-03-11T09:00:47.000Z | classifier_stgcn_real_only/utils/temp.py | 1suancaiyu/STEP | 54195112990feaee137f5137775c736d07c2d26f | [
"MIT"
] | 12 | 2020-06-23T08:11:25.000Z | 2022-03-26T11:34:42.000Z | classifier_stgcn_real_only/utils/temp.py | 1suancaiyu/STEP | 54195112990feaee137f5137775c736d07c2d26f | [
"MIT"
] | 13 | 2020-04-01T16:51:50.000Z | 2022-03-03T10:15:10.000Z | import h5py
import os
import numpy as np
base_path = os.path.dirname(os.path.realpath(__file__))
feature_file = '/media/uttaran/FCE1-7BF3/Gamma/Gait/classifier_stgcn/model_classifier_stgcn/featuresCombineddeep_features.txt'
f = np.loadtxt(feature_file)
fCombined = h5py.File('/media/uttaran/FCE1-7BF3/Gamma/Gait/data/fe... | 38.3125 | 126 | 0.76509 | import h5py
import os
import numpy as np
base_path = os.path.dirname(os.path.realpath(__file__))
feature_file = '/media/uttaran/FCE1-7BF3/Gamma/Gait/classifier_stgcn/model_classifier_stgcn/featuresCombineddeep_features.txt'
f = np.loadtxt(feature_file)
fCombined = h5py.File('/media/uttaran/FCE1-7BF3/Gamma/Gait/data/fe... | true | true |
f71b3da82b76452958e6ff8037b2e5c369373cfd | 2,253 | py | Python | python/hostconfig/machines/alexf.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/alexf.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | python/hostconfig/machines/alexf.py | stu-l/Chaste | 8efa8b440660553af66804067639f237c855f557 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Configuration for Finarfin
"""Copyright (c) 2005-2022, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and u... | 44.176471 | 79 | 0.782956 |
petsc_2_2_path = None
petsc_2_3_path = '/home/alex/petsc-2.3.2-p4/'
petsc_build_name = 'linux-gnu'
petsc_build_name_optimized = 'linux-gnu-opt'
dealii_path = None
metis_path = None
intel_path = None
other_includepaths = []
other_libpaths = ['/home/alex/hdf5/lib']
blas_lapack = ['lapack', 'blas']
other_libraries =... | true | true |
f71b400d9193c88784e05204664ee4a910ee628d | 1,831 | py | Python | awss3upload-capi/s3upload.py | krlex/aws-python-examples | 1310e82c748e3d0898809bbe909870fe4c7cb37b | [
"MIT"
] | 21 | 2021-02-13T04:11:01.000Z | 2022-03-28T09:13:53.000Z | awss3upload-capi/s3upload.py | krlex/aws-python-examples | 1310e82c748e3d0898809bbe909870fe4c7cb37b | [
"MIT"
] | null | null | null | awss3upload-capi/s3upload.py | krlex/aws-python-examples | 1310e82c748e3d0898809bbe909870fe4c7cb37b | [
"MIT"
] | 17 | 2019-07-26T06:02:27.000Z | 2022-03-23T00:06:12.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# s3upload.py
# It is an example that handles S3 buckets on AWS.
# It uses Client API (low-level) of Boto3.
# Upload a local file to a S3 bucket.
# You must provide 1 parameter:
# BUCKET_NAME = Name of the bucket
# OBJECT_NAME = Object file name in the bucket
# LOCAL_FI... | 28.609375 | 69 | 0.621518 |
import sys
import os
import boto3
import botocore
def main():
args = sys.argv[1:]
if len(args) < 3:
print('Not enough parameters.\n'\
'Proper Usage is: python s3upload.py '\
'<BUCKET_NAME> <OBJECT_NAME> <LOCAL_FILE_NAME>')
sys.exit(1)
bucke... | true | true |
f71b4058fcf0bfe5202371ab731ffe619ab85852 | 827 | py | Python | src/lambda/face-detector-function/main/image_ops/resizer.py | gai6948/video-analytics-for-ppe-compliance | bb41ac010f5917bd7e85adfed689489f24830617 | [
"Apache-2.0"
] | null | null | null | src/lambda/face-detector-function/main/image_ops/resizer.py | gai6948/video-analytics-for-ppe-compliance | bb41ac010f5917bd7e85adfed689489f24830617 | [
"Apache-2.0"
] | null | null | null | src/lambda/face-detector-function/main/image_ops/resizer.py | gai6948/video-analytics-for-ppe-compliance | bb41ac010f5917bd7e85adfed689489f24830617 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import timeit
import cv2
from PIL import Image
from aws_lambda_powertools.logging import Logger
from aws_lambda_powertools.tracing import Tracer
logger = Logger(service='face-detector', child=True)
tracer = Tracer(service='face-detector')
@tracer.capture_method(capture_response=False)
def resize_... | 33.08 | 101 | 0.759371 | import numpy as np
import timeit
import cv2
from PIL import Image
from aws_lambda_powertools.logging import Logger
from aws_lambda_powertools.tracing import Tracer
logger = Logger(service='face-detector', child=True)
tracer = Tracer(service='face-detector')
@tracer.capture_method(capture_response=False)
def resize_... | true | true |
f71b4158a84075698aa6f4b4d391c6b10747b9c5 | 2,190 | py | Python | config/settings/local.py | suyash143/Base_todo | 3284f24f8b5c611088af6189a2f264a280fbbbd6 | [
"MIT"
] | 1 | 2022-03-16T10:22:34.000Z | 2022-03-16T10:22:34.000Z | config/settings/local.py | suyash143/Base_todo | 3284f24f8b5c611088af6189a2f264a280fbbbd6 | [
"MIT"
] | 1 | 2022-03-30T21:29:43.000Z | 2022-03-30T21:29:43.000Z | config/settings/local.py | suyash143/Base_todo | 3284f24f8b5c611088af6189a2f264a280fbbbd6 | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... | 39.818182 | 97 | 0.583105 | from .base import *
from .base import env
= True
= env(
"DJANGO_SECRET_KEY",
default="00nep4XZom6FM9dVyJO6Y7kqt5JV8TN5GTNmcDnDhH0jTq3cDYEGLsyOsUYnOAsM",
)
= ["localhost", "0.0.0.0", "127.0.0.1"]
= {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATIO... | true | true |
f71b41b1f6968010d18f796949243c59c3f77265 | 2,847 | py | Python | wagtail/hooks.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | 1 | 2022-02-09T05:25:30.000Z | 2022-02-09T05:25:30.000Z | wagtail/hooks.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | wagtail/hooks.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | from contextlib import ContextDecorator
from operator import itemgetter
from wagtail.utils.apps import get_app_submodules
_hooks = {}
def register(hook_name, fn=None, order=0):
"""
Register hook for ``hook_name``. Can be used as a decorator::
@register('hook_name')
def my_hook(...):
... | 24.543103 | 82 | 0.60555 | from contextlib import ContextDecorator
from operator import itemgetter
from wagtail.utils.apps import get_app_submodules
_hooks = {}
def register(hook_name, fn=None, order=0):
if fn is None:
def decorator(fn):
register(hook_name, fn, order=order)
return fn
return... | true | true |
f71b41c7e4894d5f578583e52382342d197a0a53 | 373 | py | Python | tests/schema/mutation/snapshots/snap_test_maps_delete.py | TaiSakuma/acondbs | 990ab44ce4081cc0e04148a8375f7ce7081c2dee | [
"MIT"
] | null | null | null | tests/schema/mutation/snapshots/snap_test_maps_delete.py | TaiSakuma/acondbs | 990ab44ce4081cc0e04148a8375f7ce7081c2dee | [
"MIT"
] | null | null | null | tests/schema/mutation/snapshots/snap_test_maps_delete.py | TaiSakuma/acondbs | 990ab44ce4081cc0e04148a8375f7ce7081c2dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_schema[deleteMap] 1'] = {
'data': {
'deleteMap': {
'ok': True
}
}
}
snapshots['test_schema[deleteMa... | 16.217391 | 42 | 0.571046 |
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_schema[deleteMap] 1'] = {
'data': {
'deleteMap': {
'ok': True
}
}
}
snapshots['test_schema[deleteMap] 2'] = {
'data': {
'map': None
}
}
| true | true |
f71b4212c0a7a5b644b48292c8eaeacc6cbdda01 | 1,035 | py | Python | src/products/mixins.py | bopopescu/django-estore | c092ffa965b8ef68e71d27d34a17fde1beacd90e | [
"MIT"
] | null | null | null | src/products/mixins.py | bopopescu/django-estore | c092ffa965b8ef68e71d27d34a17fde1beacd90e | [
"MIT"
] | null | null | null | src/products/mixins.py | bopopescu/django-estore | c092ffa965b8ef68e71d27d34a17fde1beacd90e | [
"MIT"
] | 2 | 2019-04-29T14:16:10.000Z | 2020-07-23T12:04:17.000Z | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import Http404
class StaffRequiredMixin(object):
@classmethod
def as_view(self, *args, **kwargs):
view ... | 36.964286 | 85 | 0.713043 | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import Http404
class StaffRequiredMixin(object):
@classmethod
def as_view(self, *args, **kwargs):
view ... | true | true |
f71b4286b66f22ca7786f177364f1945a65ac3fc | 3,123 | py | Python | app/app/settings.py | M0narc/recipe-api | 3b6c204ca76d98310d26fcbeaa4537646a93e023 | [
"MIT"
] | 1 | 2022-03-11T20:38:42.000Z | 2022-03-11T20:38:42.000Z | app/app/settings.py | M0narc/recipe-api | 3b6c204ca76d98310d26fcbeaa4537646a93e023 | [
"MIT"
] | null | null | null | app/app/settings.py | M0narc/recipe-api | 3b6c204ca76d98310d26fcbeaa4537646a93e023 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.185484 | 91 | 0.693244 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'p2-y-!@#t0dny#e+nx-txbsphwp(yt(9t939=o_*sf%&3z2_p%'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f71b43813e699367c1eaeee665cc3b3fd3d5c5d0 | 4,573 | py | Python | hgext/fsmonitor/state.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | hgext/fsmonitor/state.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | hgext/fsmonitor/state.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # state.py - fsmonitor persistent state
#
# Copyright 2013-2016 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import errno
import os
import socket
import struct
from mercur... | 33.625 | 80 | 0.557839 |
from __future__ import absolute_import
import errno
import os
import socket
import struct
from mercurial.i18n import _
from mercurial import (
pathutil,
util,
)
_version = 4
_versionformat = ">I"
class state(object):
def __init__(self, repo):
self._vfs = repo.vfs
self._ui = repo.u... | true | true |
f71b45acabf22bbb1840898ea73829472d8e7060 | 731 | py | Python | tests/test_python3_dbb.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | tests/test_python3_dbb.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | tests/test_python3_dbb.py | bopopescu/NovalIDE | 590c2adb69d54fa4a6c9dad5459198be057b1329 | [
"MulanPSL-1.0"
] | null | null | null | import inspect
class _D:
def _m(self): pass
class _C:
def _m(self): pass
_x = _C()
_x2 = _D()
a=121111
r = input('hahah')
print(r)
raise AttributeError('Provider test already registered')
print (type(_C),_x.__class__,dir(_x),"------------")
import types
###print (dir(types))
print (type(inspect))
... | 17.404762 | 60 | 0.642955 | import inspect
class _D:
def _m(self): pass
class _C:
def _m(self): pass
_x = _C()
_x2 = _D()
a=121111
r = input('hahah')
print(r)
raise AttributeError('Provider test already registered')
print (type(_C),_x.__class__,dir(_x),"------------")
import types
lass(_C))
print (inspect.ismodule(_C))
print... | true | true |
f71b45baa1e78f59775296f091528acf3ccf2008 | 718 | py | Python | meus_projetos/projetos_python/lista_de_tarefas/minhas_funcoes.py | SabinoEduardo/Python | f46e47f166150afdf0f4c4358b5848d52667a764 | [
"MIT"
] | null | null | null | meus_projetos/projetos_python/lista_de_tarefas/minhas_funcoes.py | SabinoEduardo/Python | f46e47f166150afdf0f4c4358b5848d52667a764 | [
"MIT"
] | null | null | null | meus_projetos/projetos_python/lista_de_tarefas/minhas_funcoes.py | SabinoEduardo/Python | f46e47f166150afdf0f4c4358b5848d52667a764 | [
"MIT"
] | null | null | null | def adicionar_tarefa(lista_tarefas, tarefas):
lista_tarefas.append(tarefas)
def deletar_tarefa(lista_tarefas, tarefas_deletadas):
"""
Esta função serve para deletar a ultima tarefa da lista e guarda esta tarefa em outra lista.
"""
if not lista_tarefas:
print("Nada a deletar")
r... | 27.615385 | 100 | 0.682451 | def adicionar_tarefa(lista_tarefas, tarefas):
lista_tarefas.append(tarefas)
def deletar_tarefa(lista_tarefas, tarefas_deletadas):
if not lista_tarefas:
print("Nada a deletar")
return
tarefas_deletadas.append(lista_tarefas[-1])
lista_tarefas.pop()
def repor_tarefa(lista_tarefas, taref... | true | true |
f71b47bfd1af85c0318ff27db55a1a089a9d0ee9 | 4,549 | py | Python | pyuvm/s09_phasing.py | ktbarrett/pyuvm | 725e6e4b8088aa085a5ce16861b46db49ce46672 | [
"Apache-2.0"
] | 4 | 2021-11-07T13:22:27.000Z | 2022-02-17T08:51:24.000Z | pyuvm/s09_phasing.py | ktbarrett/pyuvm | 725e6e4b8088aa085a5ce16861b46db49ce46672 | [
"Apache-2.0"
] | null | null | null | pyuvm/s09_phasing.py | ktbarrett/pyuvm | 725e6e4b8088aa085a5ce16861b46db49ce46672 | [
"Apache-2.0"
] | null | null | null | from pyuvm.s05_base_classes import uvm_object
import pyuvm.error_classes as error_classes
import cocotb
# 9.1
#
# This is a dramatically simplified version of UVM phasing. We don't have
# to deal with simulation time and we are not going to deal with a generalized
# phasing system.
#
# So this system simply traverses ... | 27.737805 | 78 | 0.667619 | from pyuvm.s05_base_classes import uvm_object
import pyuvm.error_classes as error_classes
import cocotb
# to deal with simulation time and we are not going to deal with a generalized
# phasing system.
#
# So this system simply traverses the common phases, calling the appropriate
# method in each component.
#
# Much... | true | true |
f71b486fd1687af447da51c84625b2c67f3d5401 | 3,199 | py | Python | homeassistant/components/harmony/subscriber.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/harmony/subscriber.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/harmony/subscriber.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Mixin class for handling harmony callback subscriptions."""
import asyncio
import logging
# pylint: disable-next=deprecated-typing-alias
# Issue with Python 3.9.0 and 3.9.1 with collections.abc.Callable
# https://bugs.python.org/issue42965
from typing import Any, Callable, NamedTuple, Optional
from homeassistant.... | 32.979381 | 79 | 0.689278 |
import asyncio
import logging
from typing import Any, Callable, NamedTuple, Optional
from homeassistant.core import callback
_LOGGER = logging.getLogger(__name__)
NoParamCallback = Optional[Callable[[object], Any]]
ActivityCallback = Optional[Callable[[object, tuple], Any]]
class HarmonyCallback(NamedTuple):
... | true | true |
f71b492ed7fe05c2dd8f787b6d743c15e42b6651 | 23,428 | py | Python | test/test_framework/util.py | vpubchain/Phore | 7819f046e629ccb5a00fa4f89a7399a7732b4113 | [
"MIT"
] | null | null | null | test/test_framework/util.py | vpubchain/Phore | 7819f046e629ccb5a00fa4f89a7399a7732b4113 | [
"MIT"
] | null | null | null | test/test_framework/util.py | vpubchain/Phore | 7819f046e629ccb5a00fa4f89a7399a7732b4113 | [
"MIT"
] | 1 | 2019-08-10T08:20:56.000Z | 2019-08-10T08:20:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
import os
import sys
from binascii import hexlify, unhex... | 35.713415 | 201 | 0.651742 |
import os
import sys
from binascii import hexlify, unhexlify
from base64 import b64encode
from decimal import Decimal, ROUND_DOWN
import json
import http.client
import random
import shutil
import subprocess
import time
import re
import errno
from . import coverage
from .authproxy import AuthServiceProxy, JS... | true | true |
f71b49b3ed0e3ba6b9a8f90ca5e35100450fb249 | 13,385 | py | Python | skimage/segmentation/tests/test_random_walker.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | skimage/segmentation/tests/test_random_walker.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | null | null | null | skimage/segmentation/tests/test_random_walker.py | thewtex/scikit-image | 22bb6b94698b8889cbdf26b25d9e4fdb8b968d97 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from skimage.segmentation import random_walker
from skimage.transform import resize
from skimage._shared._warnings import expected_warnings
from skimage._shared import testing
# older versions of scipy raise a warning with new NumPy because they use
# numpy.rank() instead of arr.ndim or numpy.linal... | 36.175676 | 80 | 0.582219 | import numpy as np
from skimage.segmentation import random_walker
from skimage.transform import resize
from skimage._shared._warnings import expected_warnings
from skimage._shared import testing
SCIPY_EXPECTED = 'numpy.linalg.matrix_rank|\A\Z'
PYAMG_EXPECTED_WARNING = 'pyamg|\A\Z'
PYAMG_SCIPY_EXPECTED = SCIPY_EXPEC... | true | true |
f71b4ba03c952835c47e87d25a7a9beba942d977 | 8,309 | py | Python | mmdet/models/necks/mscatfpn.py | JHuang-CV/OD | 290bf90a5f210199b6a3750c88152f7dd2fbc276 | [
"Apache-2.0"
] | null | null | null | mmdet/models/necks/mscatfpn.py | JHuang-CV/OD | 290bf90a5f210199b6a3750c88152f7dd2fbc276 | [
"Apache-2.0"
] | null | null | null | mmdet/models/necks/mscatfpn.py | JHuang-CV/OD | 290bf90a5f210199b6a3750c88152f7dd2fbc276 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
from mmdet.ops.context_block import ContextBlock
from mmdet.models.plugins.squeeze_excitation import ChannelSELayer
@NECKS.... | 37.768182 | 94 | 0.564087 | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import xavier_init
from mmdet.core import auto_fp16
from ..registry import NECKS
from ..utils import ConvModule
from mmdet.ops.context_block import ContextBlock
from mmdet.models.plugins.squeeze_excitation import ChannelSELayer
@NECKS.... | true | true |
f71b4bb600bb418ed1ef7e86a5615b6ad8bfabf3 | 2,753 | py | Python | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 2 | 2020-07-24T19:26:51.000Z | 2021-08-21T21:04:11.000Z | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 1 | 2021-03-09T12:42:46.000Z | 2021-03-09T12:42:46.000Z | """MXNet Module for Attention-based Graph Neural Network layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ..softmax import edge_softmax
from ..utils import normalize
from ....utils import expand_as_pair
class AGNN... | 36.706667 | 91 | 0.553578 |
import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ..softmax import edge_softmax
from ..utils import normalize
from ....utils import expand_as_pair
class AGNNConv(nn.Block):
def __init__(self,
init_beta=1.,
learn_beta=True):
super(AGNNCon... | true | true |
f71b4d5f7826768bee64b7feec106bd5368db512 | 1,099 | py | Python | test/test_arrow_result.py | mariusvniekerk/snowflake-connector-python | 4c6b728f9ca7ac9c8a318741924a963a5574e216 | [
"Apache-2.0"
] | null | null | null | test/test_arrow_result.py | mariusvniekerk/snowflake-connector-python | 4c6b728f9ca7ac9c8a318741924a963a5574e216 | [
"Apache-2.0"
] | null | null | null | test/test_arrow_result.py | mariusvniekerk/snowflake-connector-python | 4c6b728f9ca7ac9c8a318741924a963a5574e216 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
import pytest
@pytest.mark.skip(
reason="Cython is not enabled in build env")
def test_select_with_num(conn_cnx):
with conn_cnx() as json_cnx:
with conn_cnx() as arrow_cnx:
... | 36.633333 | 87 | 0.610555 |
import pytest
@pytest.mark.skip(
reason="Cython is not enabled in build env")
def test_select_with_num(conn_cnx):
with conn_cnx() as json_cnx:
with conn_cnx() as arrow_cnx:
row_count = 50000
sql_text = ("select seq4() as c1, uniform(1, 10, random(12)) as c2 from " +
... | true | true |
f71b4eb0cc83cbb94a84bbec221dd9f3a3147026 | 25,712 | py | Python | draco/core/io.py | sjforeman/draco | b0ab40b6984637642b28a5485af1c09c9cf183f2 | [
"MIT"
] | null | null | null | draco/core/io.py | sjforeman/draco | b0ab40b6984637642b28a5485af1c09c9cf183f2 | [
"MIT"
] | null | null | null | draco/core/io.py | sjforeman/draco | b0ab40b6984637642b28a5485af1c09c9cf183f2 | [
"MIT"
] | null | null | null | """Tasks for reading and writing data.
Tasks
=====
.. autosummary::
:toctree:
LoadFiles
LoadMaps
LoadFilesFromParams
Save
Print
LoadBeamTransfer
File Groups
===========
Several tasks accept groups of files as arguments. These are specified in the YAML file as a dictionary like below.
.... | 30.285041 | 115 | 0.592253 |
import os.path
import h5py
import numpy as np
from yaml import dump as yamldump
from caput import pipeline
from caput import config
from cora.util import units
from . import task
from ..util.truncate import bit_truncate_weights, bit_truncate_fixed
from .containers import SiderealStream, TimeStream, TrackBeam
TRU... | true | true |
f71b4f651dc252f16edc83bd218126c89ab19ffc | 2,507 | py | Python | scripts/remove_orphans.py | dbaio/portsfallout | 2512036a9983b833f4ece2a0801541dca4d8d58c | [
"BSD-2-Clause"
] | 6 | 2020-10-11T07:54:50.000Z | 2022-01-25T22:03:18.000Z | scripts/remove_orphans.py | dbaio/portsfallout | 2512036a9983b833f4ece2a0801541dca4d8d58c | [
"BSD-2-Clause"
] | null | null | null | scripts/remove_orphans.py | dbaio/portsfallout | 2512036a9983b833f4ece2a0801541dca4d8d58c | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2020-2021 Danilo G. Baio <dbaio@bsd.com.br>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the... | 32.986842 | 81 | 0.723574 |
import os
import sys
import requests
import bz2
sys.path.insert(1, r'../')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portsfallout.settings')
import django
django.setup()
from ports.models import Port
def fetch_index():
url = "https://www.FreeBSD.org/ports/INDEX-13.bz2"
r = requ... | true | true |
f71b510ba2e775050928e7d131af51fdd10e9af6 | 4,481 | py | Python | scripts/mergemessages.py | burakozdemir32/django-internationalflavor | 4c5d29519050c929a608d2054c14faa44ee273c9 | [
"BSD-3-Clause"
] | null | null | null | scripts/mergemessages.py | burakozdemir32/django-internationalflavor | 4c5d29519050c929a608d2054c14faa44ee273c9 | [
"BSD-3-Clause"
] | null | null | null | scripts/mergemessages.py | burakozdemir32/django-internationalflavor | 4c5d29519050c929a608d2054c14faa44ee273c9 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import polib
import django
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
# This is almost a management command, but we do not want it to be added to the django-admin namespace for the simple
# reason that it is not expec... | 41.110092 | 117 | 0.567061 | import os
import sys
import polib
import django
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
MODULE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'internationalflavor')
LOCALE_PATH = os.path.join(MODULE_PATH, 'l... | true | true |
f71b518086dd6b504569820b3ca2a1c860242389 | 213 | py | Python | wadeem/wadeem/doctype/coordinators/test_coordinators.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | wadeem/wadeem/doctype/coordinators/test_coordinators.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | wadeem/wadeem/doctype/coordinators/test_coordinators.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Siddhant and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestCoordinators(unittest.TestCase):
pass
| 19.363636 | 47 | 0.765258 |
from __future__ import unicode_literals
import unittest
class TestCoordinators(unittest.TestCase):
pass
| true | true |
f71b5347247e075de1cdb3afefef4dff57d2b7aa | 802 | py | Python | multiqc_npm/modules/npm_calculate_callability.py | c-BIG/MultiQC_NPM | c8dbf15c2b2ce03f2932db0bb50d49dcab865d75 | [
"MIT"
] | null | null | null | multiqc_npm/modules/npm_calculate_callability.py | c-BIG/MultiQC_NPM | c8dbf15c2b2ce03f2932db0bb50d49dcab865d75 | [
"MIT"
] | null | null | null | multiqc_npm/modules/npm_calculate_callability.py | c-BIG/MultiQC_NPM | c8dbf15c2b2ce03f2932db0bb50d49dcab865d75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Parser for calculate_callability.py
"""
import logging
import json
from multiqc.utils import report
log = logging.getLogger(__name__)
def parse_reports(self):
# Set up vars
self.calculate_callability = dict()
# Collect metrics
for f in self.find_log_files('multiqc_npm/... | 22.914286 | 93 | 0.706983 |
import logging
import json
from multiqc.utils import report
log = logging.getLogger(__name__)
def parse_reports(self):
self.calculate_callability = dict()
for f in self.find_log_files('multiqc_npm/calculate_callability'):
parsed_data = json.loads(f["f"])
s_name = f["s... | true | true |
f71b54183262fd12198dc0255f4b1059568df90a | 14,252 | py | Python | airflow/models/connection.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | airflow/models/connection.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 1 | 2019-05-14T14:32:40.000Z | 2019-05-14T14:32:40.000Z | airflow/models/connection.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 40.72 | 97 | 0.613388 |
import json
from urllib.parse import parse_qsl, quote, unquote, urlencode, urlparse
from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import synonym
from airflow.exceptions import AirflowException
from airflow.models.bas... | true | true |
f71b5426abe6a21a2aafe3e9e5c4721319783d05 | 5,751 | py | Python | original_author_notes/yolo_video.py | adam-blinzler/simple-lane-detection | 8814e0aaf7ac56b7e5be59634e363ca17839effb | [
"MIT"
] | null | null | null | original_author_notes/yolo_video.py | adam-blinzler/simple-lane-detection | 8814e0aaf7ac56b7e5be59634e363ca17839effb | [
"MIT"
] | null | null | null | original_author_notes/yolo_video.py | adam-blinzler/simple-lane-detection | 8814e0aaf7ac56b7e5be59634e363ca17839effb | [
"MIT"
] | null | null | null | # USAGE
# python yolo_video.py --input videos/airport.mp4 --output output/airport_output.avi --object_detection object_detection-coco
# import the necessary packages
import numpy as np
import argparse
import imutils
import time
import cv2
import os
# construct the argument parse and parse the arguments
ap = argparse.... | 34.029586 | 125 | 0.704051 |
import numpy as np
import argparse
import imutils
import time
import cv2
import os
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--input", required=True,
help="path to input video")
ap.add_argument("-o", "--output", required=True,
help="path to output video")
ap.add_argument("-y", "--object_detection", ... | true | true |
f71b5468bb09f935a4b8dd8609a936248498eb63 | 7,498 | py | Python | tessia/server/api/views/auth.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | 5 | 2020-06-04T10:20:33.000Z | 2020-10-26T15:09:19.000Z | tessia/server/api/views/auth.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | tessia/server/api/views/auth.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, 2017 IBM Corp.
#
# 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 writin... | 31.771186 | 83 | 0.634169 |
from base64 import b64decode
from flask import g as flask_global
from flask import request as flask_request
from sqlalchemy.sql import func
from tessia.server import auth
from tessia.server.api.db import API_DB
from tessia.server.api.exceptions import UnauthorizedError
from tessia.server.config import... | true | true |
f71b54b467c00b5f3318a9985c87b77ec8bf71f6 | 853 | py | Python | med2img/tests/test_med2img.py | mohitchandarana/pl-med2img | c8c9df64a5e244d57e2fdb9ffadeea3c455eab23 | [
"MIT"
] | 4 | 2017-07-06T20:32:08.000Z | 2021-09-18T02:46:55.000Z | med2img/tests/test_med2img.py | mohitchandarana/pl-med2img | c8c9df64a5e244d57e2fdb9ffadeea3c455eab23 | [
"MIT"
] | 1 | 2021-11-07T20:17:16.000Z | 2021-11-08T20:11:48.000Z | med2img/tests/test_med2img.py | mohitchandarana/pl-med2img | c8c9df64a5e244d57e2fdb9ffadeea3c455eab23 | [
"MIT"
] | 3 | 2020-09-01T07:13:19.000Z | 2021-03-25T16:06:39.000Z |
from unittest import TestCase
from unittest import mock
from med2img.med2img import Med2img
class Med2imgTests(TestCase):
"""
Test Med2img.
"""
def setUp(self):
self.app = Med2img()
def test_run(self):
"""
Test the run code.
"""
args = []
if self.a... | 25.088235 | 84 | 0.594373 |
from unittest import TestCase
from unittest import mock
from med2img.med2img import Med2img
class Med2imgTests(TestCase):
def setUp(self):
self.app = Med2img()
def test_run(self):
args = []
if self.app.TYPE == 'ds':
args.append('inputdir')
args.append('outputdir'... | true | true |
f71b555a4703e5eb655f1c62d6c59060c0f772cf | 6,488 | py | Python | MPL/MPL_envs/reach/reach_v0.py | vikashplus/MPL | 4a784fd94dc7a5988a1eca85851ee546ca1992f9 | [
"Apache-2.0"
] | null | null | null | MPL/MPL_envs/reach/reach_v0.py | vikashplus/MPL | 4a784fd94dc7a5988a1eca85851ee546ca1992f9 | [
"Apache-2.0"
] | null | null | null | MPL/MPL_envs/reach/reach_v0.py | vikashplus/MPL | 4a784fd94dc7a5988a1eca85851ee546ca1992f9 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from gym import utils
from mjrl.envs import mujoco_env
from mujoco_py import MjViewer
from MPL.MPL_robot.robot import Robot
import os
# TODO: Action normalization is missing
class sallyReachEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, noise_scale=0.0):
# prep
u... | 33.968586 | 130 | 0.594945 | import numpy as np
from gym import utils
from mjrl.envs import mujoco_env
from mujoco_py import MjViewer
from MPL.MPL_robot.robot import Robot
import os
class sallyReachEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self, noise_scale=0.0):
utils.EzPickle.__init__(self)
self._no... | true | true |
f71b560fdbc2811c07e38208065e693e4befa940 | 40,786 | py | Python | metaflow/plugins/aws/step_functions/step_functions.py | cclauss/metaflow | 5186c6c5bba36d9e77077413ee2495dc79da3dca | [
"Apache-2.0"
] | 1 | 2021-11-29T22:37:54.000Z | 2021-11-29T22:37:54.000Z | metaflow/plugins/aws/step_functions/step_functions.py | sappier/metaflow | dfe1a216e342555d5fb127607b35491a4ef11627 | [
"Apache-2.0"
] | null | null | null | metaflow/plugins/aws/step_functions/step_functions.py | sappier/metaflow | dfe1a216e342555d5fb127607b35491a4ef11627 | [
"Apache-2.0"
] | 1 | 2021-11-29T22:37:50.000Z | 2021-11-29T22:37:50.000Z | import os
from collections import defaultdict
import sys
import hashlib
import json
import time
import string
import random
import uuid
from metaflow.exception import MetaflowException, MetaflowInternalError
from metaflow.plugins import ResourcesDecorator, BatchDecorator, RetryDecorator
from metaflow.parameters import... | 43.205508 | 88 | 0.558721 | import os
from collections import defaultdict
import sys
import hashlib
import json
import time
import string
import random
import uuid
from metaflow.exception import MetaflowException, MetaflowInternalError
from metaflow.plugins import ResourcesDecorator, BatchDecorator, RetryDecorator
from metaflow.parameters import... | true | true |
f71b5640c381e4a1a513cc6857ecd00c92aa7029 | 279 | py | Python | circle_core/writer/base.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | 3 | 2019-01-11T04:30:18.000Z | 2019-01-11T04:31:18.000Z | circle_core/writer/base.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | 16 | 2018-11-21T11:47:18.000Z | 2021-09-01T03:52:35.000Z | circle_core/writer/base.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | null | null | null | import abc
class DBWriter(metaclass=abc.ABCMeta):
@abc.abstractmethod
async def store(self, message_box, message) -> bool:
raise NotImplementedError
@abc.abstractmethod
async def flush(self, flush_all=False) -> None:
raise NotImplementedError
| 21.461538 | 56 | 0.706093 | import abc
class DBWriter(metaclass=abc.ABCMeta):
@abc.abstractmethod
async def store(self, message_box, message) -> bool:
raise NotImplementedError
@abc.abstractmethod
async def flush(self, flush_all=False) -> None:
raise NotImplementedError
| true | true |
f71b56535865b78456cbc8ac2192f63ee5287cfd | 588 | py | Python | src/UI_Code_Q2/Test_code_smaller_parts/PythonWriteUSB.py | KevinEwoudLee/HU3-UI | 16d63e0be8c515540daf4f9cfcff2d0a85c1cbab | [
"MIT"
] | 1 | 2019-12-11T15:27:53.000Z | 2019-12-11T15:27:53.000Z | src/UI_Code_Q2/Test_code_smaller_parts/PythonWriteUSB.py | KevinEwoudLee/HU3-UI | 16d63e0be8c515540daf4f9cfcff2d0a85c1cbab | [
"MIT"
] | null | null | null | src/UI_Code_Q2/Test_code_smaller_parts/PythonWriteUSB.py | KevinEwoudLee/HU3-UI | 16d63e0be8c515540daf4f9cfcff2d0a85c1cbab | [
"MIT"
] | 1 | 2019-12-11T15:23:56.000Z | 2019-12-11T15:23:56.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 09:36:21 2019
@author: kevin
"""
import os
import time
from time import sleep
from datetime import datetime
file = open("E:/test2.csv", "a")
i=0
if os.stat("E:/test2.csv").st_size == 0:
file.write("Time,Sensor1,Sensor2,Sensor3,Sensor4,Sensor5\... | 22.615385 | 97 | 0.52551 |
import os
import time
from time import sleep
from datetime import datetime
file = open("E:/test2.csv", "a")
i=0
if os.stat("E:/test2.csv").st_size == 0:
file.write("Time,Sensor1,Sensor2,Sensor3,Sensor4,Sensor5\n")
while True:
i=i+1
now = datetime.now()
file.write(str(now... | true | true |
f71b56ae1d0e79e35e8bd9e7c4c05e6ff33f45bf | 3,286 | py | Python | src/util/pos_util.py | tiefenauer/ip7-python | 512105ba39110ec77d2ea0961dd7c2a42d4ec26d | [
"MIT"
] | null | null | null | src/util/pos_util.py | tiefenauer/ip7-python | 512105ba39110ec77d2ea0961dd7c2a42d4ec26d | [
"MIT"
] | null | null | null | src/util/pos_util.py | tiefenauer/ip7-python | 512105ba39110ec77d2ea0961dd7c2a42d4ec26d | [
"MIT"
] | null | null | null | import collections
from src.importer.known_jobs import KnownJobs
from src.preprocessing import preproc
from src.util import loe_util, jobtitle_util
mw_tokens = ['m/w', 'w/m', 'm/f', 'f/m',
'M/W', 'W/M', 'M/F', 'F/M']
def find_jobs(sentence):
jobs = []
# find known jobs
for hit in find_job_b... | 30.71028 | 101 | 0.676811 | import collections
from src.importer.known_jobs import KnownJobs
from src.preprocessing import preproc
from src.util import loe_util, jobtitle_util
mw_tokens = ['m/w', 'w/m', 'm/f', 'f/m',
'M/W', 'W/M', 'M/F', 'F/M']
def find_jobs(sentence):
jobs = []
for hit in find_job_by_keyword(sentenc... | true | true |
f71b56c4085612ca2aacc209126330286fb3b4f9 | 2,980 | py | Python | webvep/main/settings.py | IanVermes/vep_api | 9d9d31eddd969aad1c462278ea1f1fb09153e054 | [
"MIT"
] | null | null | null | webvep/main/settings.py | IanVermes/vep_api | 9d9d31eddd969aad1c462278ea1f1fb09153e054 | [
"MIT"
] | 1 | 2020-03-30T10:52:58.000Z | 2020-03-30T16:46:31.000Z | webvep/main/settings.py | IanVermes/vep_api | 9d9d31eddd969aad1c462278ea1f1fb09153e054 | [
"MIT"
] | null | null | null | """
Django settings for webvep project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# ... | 26.607143 | 91 | 0.711409 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = "ec)mzu6ls4qaj!8)txrke(uxxtb1gmz^2a_^1$lqe9&ys17^!$"
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.content... | true | true |
f71b57614025c4aecf90a7ea7cf4fe3d2b9c8499 | 77 | py | Python | zmon_aws_agent/__main__.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 9 | 2016-07-28T09:28:20.000Z | 2022-02-27T23:40:09.000Z | zmon_aws_agent/__main__.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 146 | 2016-05-23T13:43:42.000Z | 2020-03-10T09:47:07.000Z | zmon_aws_agent/__main__.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 11 | 2017-02-18T12:46:27.000Z | 2020-01-22T13:13:36.000Z | from zmon_aws_agent.main import main
if __name__ == '__main__':
main()
| 12.833333 | 36 | 0.701299 | from zmon_aws_agent.main import main
if __name__ == '__main__':
main()
| true | true |
f71b584d40b3c272f7646b95950ee740aeb0fc1c | 5,834 | py | Python | tests/model_connectors/test_spawn_ets.py | macintoshpie/geojson-modelica-translator | 5ed02d53f06961b8d0f3705343368e4c920e7d7d | [
"BSD-3-Clause"
] | null | null | null | tests/model_connectors/test_spawn_ets.py | macintoshpie/geojson-modelica-translator | 5ed02d53f06961b8d0f3705343368e4c920e7d7d | [
"BSD-3-Clause"
] | null | null | null | tests/model_connectors/test_spawn_ets.py | macintoshpie/geojson-modelica-translator | 5ed02d53f06961b8d0f3705343368e4c920e7d7d | [
"BSD-3-Clause"
] | null | null | null | """
****************************************************************************************************
:copyright (c) 2019-2020 URBANopt, Alliance for Sustainable Energy, LLC, and other contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
... | 44.876923 | 114 | 0.711176 |
import os
import shutil
import unittest
from pathlib import Path
from geojson_modelica_translator.geojson_modelica_translator import (
GeoJsonModelicaTranslator
)
from geojson_modelica_translator.model_connectors.spawnBui_ETS_Coupling import (
SpawnConnectorETS
)
from geojson_modelica_translator.modelica.mode... | true | true |
f71b58bc6969e1f4e15e0b32876c55ba66d9757e | 18,715 | py | Python | OLD/losses.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | 2 | 2017-11-17T06:55:44.000Z | 2019-06-11T13:07:05.000Z | OLD/losses.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | null | null | null | OLD/losses.py | ivankreso/semseg | fcd2889a1e9e03c3d1a71d19d68d15ce25a5dc79 | [
"MIT"
] | null | null | null | import tensorflow as tf
import slim
FLAGS = tf.app.flags.FLAGS
def add_loss_summaries(total_loss):
"""Add summaries for losses in model.
Generates moving average for all losses and associated summaries for
visualizing the performance of the network.
Args:
total_loss: Total loss from loss().
Returns:
... | 42.924312 | 107 | 0.704996 | import tensorflow as tf
import slim
FLAGS = tf.app.flags.FLAGS
def add_loss_summaries(total_loss):
loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg')
losses = tf.get_collection('losses')
loss_averages_op = loss_averages.apply(losses + [total_loss])
for l in losses + [total_loss]:
... | true | true |
f71b599c49ef3382050c2d01eff0c192906c1d7b | 1,580 | py | Python | aiLogic/tankAI.py | JoelEager/pyTanks.Player | a35a653e9df2416c63204aba87a95f33e6815b63 | [
"MIT"
] | 2 | 2017-03-09T15:32:55.000Z | 2017-09-04T11:25:41.000Z | aiLogic/tankAI.py | JoelEager/pyTanks.Player | a35a653e9df2416c63204aba87a95f33e6815b63 | [
"MIT"
] | null | null | null | aiLogic/tankAI.py | JoelEager/pyTanks.Player | a35a653e9df2416c63204aba87a95f33e6815b63 | [
"MIT"
] | 4 | 2017-05-16T15:10:09.000Z | 2017-07-06T15:24:50.000Z | """
The player's AI code
Functions here are called by clock.py to run the AI code
"""
import random
import math
from clientLogic.logging import logPrint
from clientLogic import clientData, commands
def onConnect():
"""
Called when the player initially connects to the server but before the tank first spaw... | 27.719298 | 92 | 0.588608 |
import random
import math
from clientLogic.logging import logPrint
from clientLogic import clientData, commands
def onConnect():
commands.setInfo("Python player instance running the example AI.\n" +
"Fork me at https://github.com/JoelEager/pyTanks.Player")
def onSpawn():
pass
def onTic... | true | true |
f71b5a856153c3564ce7371764011afc06ba93ae | 12,294 | py | Python | tests/unit/common_utils.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | tests/unit/common_utils.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | 27 | 2016-08-31T19:04:46.000Z | 2016-09-29T00:22:32.000Z | tests/unit/common_utils.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. 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 ... | 38.299065 | 80 | 0.577843 |
__author__ = 'Mike Gainer (mgainer@google.com)'
import datetime
import os
import unittest
import appengine_config
from common import utils
class CommonUnitTests(unittest.TestCase):
def test_list_parsing(self):
self.assertListEqual(['foo'], utils.text_to_list('foo'))
self.ass... | true | true |
f71b5b1995d1ecc2a1ba880156e9343a02f0c212 | 578 | py | Python | bark_ml/commons/tracer.py | bark-simulator/rl | 84f9c74b60becbc4bc758e19b201d85a21880717 | [
"MIT"
] | null | null | null | bark_ml/commons/tracer.py | bark-simulator/rl | 84f9c74b60becbc4bc758e19b201d85a21880717 | [
"MIT"
] | null | null | null | bark_ml/commons/tracer.py | bark-simulator/rl | 84f9c74b60becbc4bc758e19b201d85a21880717 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 fortiss GmbH
#
# Authors: Patrick Hart
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import pickle
class Tracer:
"""The tracer can be used to log certain values during episodes."""
def __init__(self, states=None, trace_... | 25.130435 | 69 | 0.698962 |
import pickle
class Tracer:
def __init__(self, states=None, trace_history=True):
self._trace_history = trace_history
self._states = []
def Trace(self, eval_dict):
if self._trace_history:
self._states.append(eval_dict)
def Reset(self):
self._trace_history = [] | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.