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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74c6873d7d0d06e3277969d5668a35e10aafcfb | 4,545 | py | Python | checkers/piece.py | agayev169/checkers | dabeb0bb60f9dcb93fd8f46bdd6ea764fab37ec1 | [
"MIT"
] | null | null | null | checkers/piece.py | agayev169/checkers | dabeb0bb60f9dcb93fd8f46bdd6ea764fab37ec1 | [
"MIT"
] | null | null | null | checkers/piece.py | agayev169/checkers | dabeb0bb60f9dcb93fd8f46bdd6ea764fab37ec1 | [
"MIT"
] | null | null | null | from math import ceil
class Piece:
def __init__(self):
self.player = None
self.other_player = None
self.king = False
self.captured = False
self.position = None
self.board = None
self.capture_move_enemies = {}
self.reset_for_new_board()
def reset_for_new_board(self):
self.possible_capture_moves = ... | 36.653226 | 167 | 0.776898 | from math import ceil
class Piece:
def __init__(self):
self.player = None
self.other_player = None
self.king = False
self.captured = False
self.position = None
self.board = None
self.capture_move_enemies = {}
self.reset_for_new_board()
def reset_for_new_board(self):
self.possible_capture_moves = ... | true | true |
f74c689eb925e3ffde659276de6523ef1932f1e6 | 3,002 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/StatusBarDrawItemEventHandler.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/StatusBarDrawItemEventHandler.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/StatusBarDrawItemEventHandler.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class StatusBarDrawItemEventHandler(MulticastDelegate,ICloneable,ISerializable):
"""
Represents the method that will handle the System.Windows.Forms.StatusBar.DrawItem event of a System.Windows.Forms.StatusBar.
StatusBarDrawItemEventHandler(object: object,method: IntPtr)
"""
def Instance(self):
""" Th... | 44.80597 | 215 | 0.741173 | class StatusBarDrawItemEventHandler(MulticastDelegate,ICloneable,ISerializable):
return StatusBarDrawItemEventHandler()
def BeginInvoke(self,sender,sbdevent,callback,object):
""" BeginInvoke(self: StatusBarDrawItemEventHandler,sender: object,sbdevent: StatusBarDrawItemEventArgs,callback: AsyncCallback,object: o... | true | true |
f74c6ad3570022f4d60543e4ba61b62b3a6df6aa | 569 | py | Python | license/migrations/0003_alter_licensepurchase_no_of_licenses_purchased.py | KieranSweeden/fol.io | a6f231e3f9fb96841387b04d72131470c5fc3239 | [
"OLDAP-2.5",
"OLDAP-2.4",
"OLDAP-2.3"
] | null | null | null | license/migrations/0003_alter_licensepurchase_no_of_licenses_purchased.py | KieranSweeden/fol.io | a6f231e3f9fb96841387b04d72131470c5fc3239 | [
"OLDAP-2.5",
"OLDAP-2.4",
"OLDAP-2.3"
] | null | null | null | license/migrations/0003_alter_licensepurchase_no_of_licenses_purchased.py | KieranSweeden/fol.io | a6f231e3f9fb96841387b04d72131470c5fc3239 | [
"OLDAP-2.5",
"OLDAP-2.4",
"OLDAP-2.3"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-25 07:38
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('license', '0002_licensepurchase_order_number'),
]
operations = [
migrations.AlterField(
model_name... | 28.45 | 166 | 0.690685 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('license', '0002_licensepurchase_order_number'),
]
operations = [
migrations.AlterField(
model_name='licensepurchase',
name='no_of_lic... | true | true |
f74c6c17b45651f122a2f9d5cebcc60ae635249c | 29,313 | py | Python | mesonbuild/mesonlib.py | nostream/meson | d5a6ab31bfbcec9838805c598be75abb036aff87 | [
"Apache-2.0"
] | null | null | null | mesonbuild/mesonlib.py | nostream/meson | d5a6ab31bfbcec9838805c598be75abb036aff87 | [
"Apache-2.0"
] | null | null | null | mesonbuild/mesonlib.py | nostream/meson | d5a6ab31bfbcec9838805c598be75abb036aff87 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2015 The Meson development team
# 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 agree... | 35.021505 | 152 | 0.587964 |
import sys
import stat
import time
import platform, subprocess, operator, os, shutil, re
import collections
from glob import glob
import threading
an_unpicklable_object = threading.Lock()
class MesonException(Exception):
class EnvironmentException(MesonException):
class FileMode:
... | true | true |
f74c6cd8ce4248cf1655d71ead090f03fe6d4849 | 37,065 | py | Python | private/templates/SandyRelief/config.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | 1 | 2016-12-22T09:31:22.000Z | 2016-12-22T09:31:22.000Z | private/templates/SandyRelief/config.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | private/templates/SandyRelief/config.py | waidyanatha/deprecated.sambro-eden | 62e180703a2f16d5f8fcd532335d8287b76a8175 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current, TR, TD, DIV
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
"""
Templ... | 37.782875 | 151 | 0.520626 |
try:
from collections import OrderedDict
except:
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current, TR, TD, DIV
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
settings.base.prepopulate = ["SandyRelief"]
settings.base... | true | true |
f74c6d381e23d344fc762cefcfe4551ffa46b882 | 5,235 | py | Python | primitives/tf_encrypted/primitives/paillier/primitives_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 825 | 2019-04-18T09:21:32.000Z | 2022-03-30T05:55:26.000Z | primitives/tf_encrypted/primitives/paillier/primitives_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 354 | 2019-04-18T08:42:40.000Z | 2022-03-31T18:06:31.000Z | primitives/tf_encrypted/primitives/paillier/primitives_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 161 | 2019-05-02T16:43:31.000Z | 2022-03-31T01:35:03.000Z | # pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
from absl.testing import parameterized
from tf_encrypted.primitives import paillier
from tf_encrypted.test import tf_execution_context
class EncryptionTest(parameterized.TestCase):
@parameterized.parameters(
{... | 35.612245 | 79 | 0.584527 |
import unittest
import numpy as np
import tensorflow as tf
from absl.testing import parameterized
from tf_encrypted.primitives import paillier
from tf_encrypted.test import tf_execution_context
class EncryptionTest(parameterized.TestCase):
@parameterized.parameters(
{
"run_eagerly": run_eag... | true | true |
f74c6e27da1ba356e0af4ba665bf30530115c707 | 18,283 | py | Python | catalyst/pipeline/mixins.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/pipeline/mixins.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/pipeline/mixins.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | """
Mixins classes for use with Filters and Factors.
"""
from textwrap import dedent
from numpy import (
array,
full,
recarray,
vstack,
)
from pandas import NaT as pd_NaT
from catalyst.errors import (
WindowLengthNotPositive,
UnsupportedDataType,
NoFurtherDataError,
)
fro... | 34.173832 | 80 | 0.5597 | from textwrap import dedent
from numpy import (
array,
full,
recarray,
vstack,
)
from pandas import NaT as pd_NaT
from catalyst.errors import (
WindowLengthNotPositive,
UnsupportedDataType,
NoFurtherDataError,
)
from catalyst.utils.control_flow import nullctx
from catalyst.... | true | true |
f74c6e8dceb21ba17dff932bcd6f83a9efbe982e | 5,970 | py | Python | bfg9000/backends/msbuild/solution.py | Mattlk13/bfg9000 | 2d897db09ea81a0ffef0a52f2e06cb9cb4a70a02 | [
"BSD-3-Clause"
] | 72 | 2015-06-23T02:35:13.000Z | 2021-12-08T01:47:40.000Z | bfg9000/backends/msbuild/solution.py | jimporter/bfg9000 | c206646ecfed0d1a510e993b93e6a15677f45a14 | [
"BSD-3-Clause"
] | 139 | 2015-03-01T18:48:17.000Z | 2021-06-18T15:45:14.000Z | bfg9000/backends/msbuild/solution.py | Mattlk13/bfg9000 | 2d897db09ea81a0ffef0a52f2e06cb9cb4a70a02 | [
"BSD-3-Clause"
] | 19 | 2015-12-23T21:24:33.000Z | 2022-01-06T04:04:41.000Z | import json
import uuid
from collections import OrderedDict
from ... import path
from ...iterutils import first
__all__ = ['SlnBuilder', 'SlnElement', 'SlnVariable', 'Solution', 'UuidMap']
class SlnElement:
def __init__(self, name, arg=None, value=None):
if (arg is None) != (value is None):
... | 29.554455 | 79 | 0.552429 | import json
import uuid
from collections import OrderedDict
from ... import path
from ...iterutils import first
__all__ = ['SlnBuilder', 'SlnElement', 'SlnVariable', 'Solution', 'UuidMap']
class SlnElement:
def __init__(self, name, arg=None, value=None):
if (arg is None) != (value is None):
... | true | true |
f74c6ec6d100e318aebe11e8df86e2cd919e3dd8 | 109 | py | Python | timeseria/models/__init__.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | 8 | 2021-01-02T17:43:13.000Z | 2022-02-22T09:07:22.000Z | timeseria/models/__init__.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | 20 | 2020-07-15T11:29:41.000Z | 2022-03-29T22:51:52.000Z | timeseria/models/__init__.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | null | null | null | from .base import *
from .reconstructors import *
from .forecasters import *
from .anomaly_detectors import * | 27.25 | 32 | 0.788991 | from .base import *
from .reconstructors import *
from .forecasters import *
from .anomaly_detectors import * | true | true |
f74c6ec7a291c13d0569f6b30b726871955cfca9 | 1,994 | py | Python | web_app/routes/company_routes.py | ssbyrne89/DIYInvestmentPrimer | eae81d9e7c67b5d912bc7ed7037432f03ee4792c | [
"MIT"
] | null | null | null | web_app/routes/company_routes.py | ssbyrne89/DIYInvestmentPrimer | eae81d9e7c67b5d912bc7ed7037432f03ee4792c | [
"MIT"
] | null | null | null | web_app/routes/company_routes.py | ssbyrne89/DIYInvestmentPrimer | eae81d9e7c67b5d912bc7ed7037432f03ee4792c | [
"MIT"
] | null | null | null | # web_app/routes/company_routes.py
import pandas as pd
from flask import Blueprint, jsonify, request, render_template #, flash, redirect
from web_app.models import *
company_routes = Blueprint("company_routes", __name__)
@company_routes.route("/div_yield")
def seeDivYield():
return render_template("highest_DivYi... | 35.607143 | 95 | 0.65998 |
import pandas as pd
from flask import Blueprint, jsonify, request, render_template
from web_app.models import *
company_routes = Blueprint("company_routes", __name__)
@company_routes.route("/div_yield")
def seeDivYield():
return render_template("highest_DivYield_charts.html")
@company_routes.route("/highest_i... | true | true |
f74c72c4b5a67cd58e4ce860a5f4310b2643c726 | 679 | py | Python | app/models.py | Kipkorir2017/News-Site | 425e148d8202e7ca981768dc78961e91fd56acb5 | [
"MIT"
] | null | null | null | app/models.py | Kipkorir2017/News-Site | 425e148d8202e7ca981768dc78961e91fd56acb5 | [
"MIT"
] | null | null | null | app/models.py | Kipkorir2017/News-Site | 425e148d8202e7ca981768dc78961e91fd56acb5 | [
"MIT"
] | null | null | null | class Sources:
'''
sources class to define news sources objects
'''
def __init__(self,id,name,description,url,category,country):
self.id = id
self.name = name
self.description=description
self.url=url
self.category=category
self.country=country
cla... | 22.633333 | 78 | 0.633284 | class Sources:
def __init__(self,id,name,description,url,category,country):
self.id = id
self.name = name
self.description=description
self.url=url
self.category=category
self.country=country
class Articles:
def __init__(self,id,author,title,description,url,urlT... | true | true |
f74c72d9b578ed7d8a63cf9011f4c4b9ebbba9a4 | 955 | py | Python | e_website/flask_site/__init__.py | EthanH43/text_generator | 363361b3320ec731401518d0bb428d00a9194d2b | [
"MIT"
] | null | null | null | e_website/flask_site/__init__.py | EthanH43/text_generator | 363361b3320ec731401518d0bb428d00a9194d2b | [
"MIT"
] | null | null | null | e_website/flask_site/__init__.py | EthanH43/text_generator | 363361b3320ec731401518d0bb428d00a9194d2b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask, render_template
import flask_site.model as model
def create_app(test_config=None):
"""Create and configure the app.
Parameters
----------
test_config - Defaults to None, but can be used to set
up config for testing.
Returns
-------
Returns the app.
""... | 18.365385 | 61 | 0.684817 |
from flask import Flask, render_template
import flask_site.model as model
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev'
)
if test_config is None:
app.config.from_pyfile('config.py', silent=True)
else:
app.config.f... | true | true |
f74c73866a0e27c090988b9059c67ead782e6f4f | 244 | py | Python | OS_Script/core.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | OS_Script/core.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | OS_Script/core.py | yunleopard/data_py | c98fc075569732bac67a8f60719a39b1e1cc6eeb | [
"Apache-2.0"
] | null | null | null | '''
Created on Nov 12, 2018
@author: yangzh
'''
from . import helpers
def say_hi():
"""Get a thought."""
return 'Hi, my friend ...'
def saySomething():
"""Contemplation..."""
if helpers.get_answer():
print(say_hi()) | 15.25 | 31 | 0.577869 | from . import helpers
def say_hi():
return 'Hi, my friend ...'
def saySomething():
if helpers.get_answer():
print(say_hi()) | true | true |
f74c74a9352658dfc1a5f87355bb43409e55bd8d | 15,451 | py | Python | trove/common/strategies/cluster/experimental/cassandra/taskmanager.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 244 | 2015-01-01T12:04:44.000Z | 2022-03-25T23:38:39.000Z | trove/common/strategies/cluster/experimental/cassandra/taskmanager.py | ttcong/trove | 1db2dc63fdd5409eafccebe79ff2900d0535ed13 | [
"Apache-2.0"
] | 6 | 2015-08-18T08:19:10.000Z | 2022-03-05T02:32:36.000Z | trove/common/strategies/cluster/experimental/cassandra/taskmanager.py | ttcong/trove | 1db2dc63fdd5409eafccebe79ff2900d0535ed13 | [
"Apache-2.0"
] | 178 | 2015-01-02T15:16:58.000Z | 2022-03-23T03:30:20.000Z | # Copyright 2015 Tesora 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 a... | 41.534946 | 79 | 0.589541 |
from eventlet.timeout import Timeout
from oslo_log import log as logging
from trove.common import cfg
from trove.common.strategies.cluster import base
from trove.common import utils
from trove.instance.models import DBInstance
from trove.instance.models import Instance
from trove.instance import tasks a... | true | true |
f74c764fe71bef2147f00a9ea1ac6568815a83e4 | 484 | py | Python | pavo_cristatus/tests/doubles/module_fakes/non_annotated/module_fake_class_with_nested_annotated_callables.py | MATTHEWFRAZER/pavo_cristatus | a4b96c0eb6c454fbe38d2092e29f63457a4ee955 | [
"MIT"
] | null | null | null | pavo_cristatus/tests/doubles/module_fakes/non_annotated/module_fake_class_with_nested_annotated_callables.py | MATTHEWFRAZER/pavo_cristatus | a4b96c0eb6c454fbe38d2092e29f63457a4ee955 | [
"MIT"
] | null | null | null | pavo_cristatus/tests/doubles/module_fakes/non_annotated/module_fake_class_with_nested_annotated_callables.py | MATTHEWFRAZER/pavo_cristatus | a4b96c0eb6c454fbe38d2092e29f63457a4ee955 | [
"MIT"
] | null | null | null | from pavo_cristatus.tests.doubles.module_fakes.module_fake_class import ModuleFakeClass
from trochilidae.interoperable_with_metaclass import interoperable_with_metaclass_future
__all__ = ["ModuleFakeClassWithNestedAnnotatedCallables"]
class ModuleFakeClassWithNestedAnnotatedCallables(interoperable_with_metaclass_fut... | 40.333333 | 104 | 0.82438 | from pavo_cristatus.tests.doubles.module_fakes.module_fake_class import ModuleFakeClass
from trochilidae.interoperable_with_metaclass import interoperable_with_metaclass_future
__all__ = ["ModuleFakeClassWithNestedAnnotatedCallables"]
class ModuleFakeClassWithNestedAnnotatedCallables(interoperable_with_metaclass_fut... | true | true |
f74c76ea5922547b91469675ced5f92f452e80b7 | 2,348 | py | Python | tests/wrappers/time_limit_wrappers_test.py | sahirgomez1/CompilerGym | 9987fbdfcf8ac9af076baf0ffd695e48f0e804cf | [
"MIT"
] | null | null | null | tests/wrappers/time_limit_wrappers_test.py | sahirgomez1/CompilerGym | 9987fbdfcf8ac9af076baf0ffd695e48f0e804cf | [
"MIT"
] | 1 | 2022-03-01T15:16:24.000Z | 2022-03-01T15:16:24.000Z | tests/wrappers/time_limit_wrappers_test.py | sahirgomez1/CompilerGym | 9987fbdfcf8ac9af076baf0ffd695e48f0e804cf | [
"MIT"
] | 2 | 2022-02-01T08:42:57.000Z | 2022-03-01T19:11:13.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/wrappers."""
from compiler_gym.envs.llvm import LlvmEnv
from compiler_gym.wrappers import TimeLimit
from tests... | 27.302326 | 69 | 0.6546 |
from compiler_gym.envs.llvm import LlvmEnv
from compiler_gym.wrappers import TimeLimit
from tests.test_main import main
pytest_plugins = ["tests.pytest_plugins.llvm"]
def test_wrapped_close(env: LlvmEnv):
env = TimeLimit(env, max_episode_steps=5)
env.close()
assert env.service is None
def test_wrap... | true | true |
f74c788e4c38ce6fc49c293faa48a3d2846ce2dd | 1,037 | py | Python | setup.py | bexl/bexl-py | 8142163d10e07bac65ff8efdf5391108626115b8 | [
"MIT"
] | 1 | 2020-11-27T05:24:06.000Z | 2020-11-27T05:24:06.000Z | setup.py | bexl/bexl-py | 8142163d10e07bac65ff8efdf5391108626115b8 | [
"MIT"
] | null | null | null | setup.py | bexl/bexl-py | 8142163d10e07bac65ff8efdf5391108626115b8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='bexl',
version='0.1.0',
description='A parser and interpreter for the Basic EXpression Language'
' (BEXL)',
long_description=open('README.rst', 'r').read(),
keywords='bexl basic expression language',
author='Jason Simeone',
autho... | 27.289474 | 76 | 0.590164 | from setuptools import setup, find_packages
setup(
name='bexl',
version='0.1.0',
description='A parser and interpreter for the Basic EXpression Language'
' (BEXL)',
long_description=open('README.rst', 'r').read(),
keywords='bexl basic expression language',
author='Jason Simeone',
autho... | true | true |
f74c79486fecfba7970cce97d96a8b5d5046097b | 1,203 | py | Python | samples/client_publish_ws.py | petnet-independence-project/hbmq | 72947007235040720cc2d1ecf51fa61ffa63c347 | [
"MIT"
] | null | null | null | samples/client_publish_ws.py | petnet-independence-project/hbmq | 72947007235040720cc2d1ecf51fa61ffa63c347 | [
"MIT"
] | 2 | 2020-12-31T06:37:20.000Z | 2021-01-07T21:36:02.000Z | samples/client_publish_ws.py | petnet-independence-project/hbmqtt | 72947007235040720cc2d1ecf51fa61ffa63c347 | [
"MIT"
] | null | null | null | import logging
import asyncio
from hbmqtt.client import MQTTClient
from hbmqtt.mqtt.constants import QOS_1, QOS_2
#
# This sample shows how to publish messages to broker using different QOS
# Debug outputs shows the message flows
#
logger = logging.getLogger(__name__)
config = {
"will": {
"topic": "/wi... | 27.340909 | 87 | 0.664173 | import logging
import asyncio
from hbmqtt.client import MQTTClient
from hbmqtt.mqtt.constants import QOS_1, QOS_2
logger = logging.getLogger(__name__)
config = {
"will": {
"topic": "/will/client",
"message": b"Dead or alive",
"qos": 0x01,
"retain": True,
},
"capath":... | true | true |
f74c7a61f7ad601fec8529d67523c2fec79853dc | 5,069 | py | Python | src/save_to_google_team_drive.py | ndlib/marble-web-kiosk-export | 03d44c64681c96e4166bae037e1cc894f78e0fa8 | [
"Apache-2.0"
] | null | null | null | src/save_to_google_team_drive.py | ndlib/marble-web-kiosk-export | 03d44c64681c96e4166bae037e1cc894f78e0fa8 | [
"Apache-2.0"
] | null | null | null | src/save_to_google_team_drive.py | ndlib/marble-web-kiosk-export | 03d44c64681c96e4166bae037e1cc894f78e0fa8 | [
"Apache-2.0"
] | null | null | null | # save_to_google_team_drive.py
""" Saves a file to a Google Team Drive, in a given parent folder """
import os
import sys
where_i_am = os.path.dirname(os.path.realpath(__file__))
sys.path.append(where_i_am)
sys.path.append(where_i_am + "/dependencies")
from google.oauth2 import service_account # noqa: E402
from googl... | 47.373832 | 118 | 0.674492 |
import os
import sys
where_i_am = os.path.dirname(os.path.realpath(__file__))
sys.path.append(where_i_am)
sys.path.append(where_i_am + "/dependencies")
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
def _get_credentials_fr... | true | true |
f74c7abdf217a720a0f8db63087ef899e54b1cae | 1,514 | py | Python | setup.py | ethru/bookmejster | b0708c8cd50450a978270c24eee2d4f980cefea6 | [
"MIT"
] | 1 | 2021-09-22T22:58:33.000Z | 2021-09-22T22:58:33.000Z | setup.py | ethru/bookmejster | b0708c8cd50450a978270c24eee2d4f980cefea6 | [
"MIT"
] | 4 | 2021-06-08T21:05:07.000Z | 2022-03-12T00:19:25.000Z | setup.py | ethru/bookmejster | b0708c8cd50450a978270c24eee2d4f980cefea6 | [
"MIT"
] | null | null | null | from setuptools import setup
from sys import platform
from bookmeister import __version__
with open('README.md') as readme:
long_description = readme.read()
with open('requirements.txt') as required:
requirements = required.read()
data_files = []
if platform == 'linux':
data_files.append(('share/applica... | 32.212766 | 91 | 0.628798 | from setuptools import setup
from sys import platform
from bookmeister import __version__
with open('README.md') as readme:
long_description = readme.read()
with open('requirements.txt') as required:
requirements = required.read()
data_files = []
if platform == 'linux':
data_files.append(('share/applica... | true | true |
f74c7bd9a54cc09d37f3f673d3fd2d7cff7a604c | 3,096 | py | Python | openapi_genclient/models/portfolio.py | nicholasid7/tnk_open_api | 25829e974ef45a925568278c02df701979526a28 | [
"Unlicense"
] | null | null | null | openapi_genclient/models/portfolio.py | nicholasid7/tnk_open_api | 25829e974ef45a925568278c02df701979526a28 | [
"Unlicense"
] | null | null | null | openapi_genclient/models/portfolio.py | nicholasid7/tnk_open_api | 25829e974ef45a925568278c02df701979526a28 | [
"Unlicense"
] | null | null | null | # coding: utf-8
"""
OpenAPI
tinkoff.ru/invest OpenAPI. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: n.v.melnikov@tinkoff.ru
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Portfolio(object):
"""NOTE: This class ... | 26.921739 | 95 | 0.562984 |
import pprint
import re
import six
class Portfolio(object):
openapi_types = {
'positions': 'list[PortfolioPosition]'
}
attribute_map = {
'positions': 'positions'
}
def __init__(self, positions=None):
self._positions = None
self.discriminator = None
... | true | true |
f74c7c3f1a9bcdbb3a8fd3cffb9abcdfe5d3239f | 62 | py | Python | source/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 2 | 2020-12-20T01:05:23.000Z | 2021-09-17T08:53:30.000Z | source/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 2 | 2021-05-27T19:47:25.000Z | 2021-05-28T17:11:23.000Z | source/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 1 | 2021-04-21T17:21:39.000Z | 2021-04-21T17:21:39.000Z | from documentModel import *
from NGramGraphCollector import *
| 20.666667 | 33 | 0.83871 | from documentModel import *
from NGramGraphCollector import *
| true | true |
f74c7c7b4af66d691d7df06caf520cb49144a00f | 5,743 | py | Python | qolo/viz_traj.py | epfl-lasa/crowdbot-evaluation-tools | 0e98c76428f6af5a4caa6b83b91ac05b3ed300ce | [
"MIT"
] | 4 | 2022-01-26T13:10:23.000Z | 2022-03-02T19:42:11.000Z | qolo/viz_traj.py | epfl-lasa/crowdbot-evaluation-tools | 0e98c76428f6af5a4caa6b83b91ac05b3ed300ce | [
"MIT"
] | null | null | null | qolo/viz_traj.py | epfl-lasa/crowdbot-evaluation-tools | 0e98c76428f6af5a4caa6b83b91ac05b3ed300ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*-coding:utf-8 -*-
# =============================================================================
"""
@Author : Yujie He
@File : viz_traj.py
@Date created : 2022/02/25
@Maintainer : Yujie He
@Email : yujie.he@epfl.ch
"""
# ================================... | 31.554945 | 96 | 0.590284 |
import os
import sys
import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from qolo.core.crowdbot_data import CrowdBotDatabase
from qolo.utils.geo_util import quat2yaw
from qolo.utils.file_io_util import (
load_json2dict,
load_pkl2dict,
)
from qolo.utils.res_plot_util ... | true | true |
f74c7c9970f5554131bc47cbfde728f714e7fa1a | 5,693 | py | Python | code/main_GUI.py | EvelynVoce/Film-suggestion-algorithm | d3ba498e68cbea26eb7c19d7eee77edb16feda34 | [
"MIT"
] | null | null | null | code/main_GUI.py | EvelynVoce/Film-suggestion-algorithm | d3ba498e68cbea26eb7c19d7eee77edb16feda34 | [
"MIT"
] | null | null | null | code/main_GUI.py | EvelynVoce/Film-suggestion-algorithm | d3ba498e68cbea26eb7c19d7eee77edb16feda34 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import messagebox
import utility
from table_management import create_table, insert_media_table
from suggestion_algorithm import main_algorithm, suggestion_algorithm_single_use, selecting_media, list_of_media_classes
from account_handling import updating_account_data
from filters import... | 41.253623 | 120 | 0.694713 | import tkinter as tk
from tkinter import messagebox
import utility
from table_management import create_table, insert_media_table
from suggestion_algorithm import main_algorithm, suggestion_algorithm_single_use, selecting_media, list_of_media_classes
from account_handling import updating_account_data
from filters import... | true | true |
f74c7cf6114de82e3a9531291339e36a03cff92b | 1,637 | py | Python | lifegame_lj.py | muzudho/collatz | da99c1cf4cc65c42eeb3ea07134c0e25fc35e606 | [
"MIT"
] | null | null | null | lifegame_lj.py | muzudho/collatz | da99c1cf4cc65c42eeb3ea07134c0e25fc35e606 | [
"MIT"
] | null | null | null | lifegame_lj.py | muzudho/collatz | da99c1cf4cc65c42eeb3ea07134c0e25fc35e606 | [
"MIT"
] | null | null | null | """
左寄せ表記(Left justified)
"""
import os
import numpy as np
# 環境変数
RADIX = int(os.getenv("RADIX", 2))
# 桁揃えに利用。10進数27 を指定したときの見やすさをデフォルトにするぜ(^~^)
count_width = 3
count_str = ""
dec_width = 4
dec_str = ""
radix_str = ""
# 表示した数の個数
count = 0
def update_print_number(dec):
"""表示するテキストの更新"""
global count_width
... | 17.602151 | 51 | 0.62248 |
import os
import numpy as np
RADIX = int(os.getenv("RADIX", 2))
count_width = 3
count_str = ""
dec_width = 4
dec_str = ""
radix_str = ""
count = 0
def update_print_number(dec):
global count_width
global count_str
global dec_width
global dec_str
global radix_str
global count
global RAD... | true | true |
f74c7d8f625bddd31c8445696ac6328e23d47184 | 3,490 | py | Python | conans/test/integration/build_requires_test.py | nesono/conan | 1fd70a2e43ef3cc6eacf9b9f8b802d90bcd92d52 | [
"MIT"
] | null | null | null | conans/test/integration/build_requires_test.py | nesono/conan | 1fd70a2e43ef3cc6eacf9b9f8b802d90bcd92d52 | [
"MIT"
] | null | null | null | conans/test/integration/build_requires_test.py | nesono/conan | 1fd70a2e43ef3cc6eacf9b9f8b802d90bcd92d52 | [
"MIT"
] | null | null | null | import unittest
from nose_parameterized.parameterized import parameterized
from conans.test.utils.tools import TestClient
from conans.paths import CONANFILE
tool_conanfile = """
import os
from conans import ConanFile
class Tool(ConanFile):
name = "Tool"
version = "0.1"
def package_info(self):
s... | 35.979381 | 93 | 0.678797 | import unittest
from nose_parameterized.parameterized import parameterized
from conans.test.utils.tools import TestClient
from conans.paths import CONANFILE
tool_conanfile = """
import os
from conans import ConanFile
class Tool(ConanFile):
name = "Tool"
version = "0.1"
def package_info(self):
s... | true | true |
f74c7da14d5d5d8737fb278ca6bf9d0741d533e0 | 4,235 | py | Python | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/mods.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, jsonify, request, url_for, redirect, flash, \
abort, current_app as app
from mcarch.model.mod import Mod, ModAuthor, ModVersion, GameVersion
from mcarch.model.mod.draft import DraftMod
from mcarch.model.mod.logs import LogMod, gen_diffs
from mcarch.model.user impor... | 36.508621 | 98 | 0.691854 | from flask import Blueprint, render_template, jsonify, request, url_for, redirect, flash, \
abort, current_app as app
from mcarch.model.mod import Mod, ModAuthor, ModVersion, GameVersion
from mcarch.model.mod.draft import DraftMod
from mcarch.model.mod.logs import LogMod, gen_diffs
from mcarch.model.user impor... | true | true |
f74c7e98bf6ea8f6f18f29b6a69bd1c363d45f96 | 7,054 | py | Python | protorpc/wsgi/service_test.py | Zoramite/protorpc | 965c9e6711bfa1d27af09fddb196a55ff2d42bf6 | [
"Apache-2.0"
] | null | null | null | protorpc/wsgi/service_test.py | Zoramite/protorpc | 965c9e6711bfa1d27af09fddb196a55ff2d42bf6 | [
"Apache-2.0"
] | null | null | null | protorpc/wsgi/service_test.py | Zoramite/protorpc | 965c9e6711bfa1d27af09fddb196a55ff2d42bf6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2011 Google 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 o... | 34.242718 | 77 | 0.714772 |
__author__ = 'rafek@google.com (Rafe Kaplan)'
import unittest
from protorpc import end2end_test
from protorpc import protojson
from protorpc import remote
from protorpc import registry
from protorpc import transport
from protorpc import test_util
from protorpc import webapp_test_util
from protorpc... | true | true |
f74c7ed085da8637189b861e76caf9835907a0e5 | 281 | py | Python | tests/base_tests/expression_tests/test_pickle.py | lycantropos/symba | 279bf86311d50fde55d17c843391f9f83ea31ddf | [
"MIT"
] | 2 | 2021-03-15T12:23:15.000Z | 2022-03-26T21:20:54.000Z | tests/base_tests/expression_tests/test_pickle.py | lycantropos/symba | 279bf86311d50fde55d17c843391f9f83ea31ddf | [
"MIT"
] | null | null | null | tests/base_tests/expression_tests/test_pickle.py | lycantropos/symba | 279bf86311d50fde55d17c843391f9f83ea31ddf | [
"MIT"
] | null | null | null | from hypothesis import given
from symba.base import Expression
from tests.utils import pickle_round_trip
from . import strategies
@given(strategies.definite_expressions)
def test_round_trip(expression: Expression) -> None:
assert pickle_round_trip(expression) == expression
| 25.545455 | 54 | 0.822064 | from hypothesis import given
from symba.base import Expression
from tests.utils import pickle_round_trip
from . import strategies
@given(strategies.definite_expressions)
def test_round_trip(expression: Expression) -> None:
assert pickle_round_trip(expression) == expression
| true | true |
f74c7eee2dda25266ad68c6597ee9077cbc931a3 | 184 | py | Python | RestAdm/apps/system/apps.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | null | null | null | RestAdm/apps/system/apps.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | 54 | 2020-06-24T07:12:19.000Z | 2022-03-12T00:43:57.000Z | RestAdm/apps/system/apps.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'system'
verbose_name = '系统'
# 通过ready 来导入信号量
def ready(self):
import system.signals
| 16.727273 | 33 | 0.668478 | from django.apps import AppConfig
class SystemConfig(AppConfig):
name = 'system'
verbose_name = '系统'
def ready(self):
import system.signals
| true | true |
f74c7f0b56ac57a5a78ed62b1db67141d187186f | 758 | py | Python | src/utils/image.py | danifarre/pneumonia-detection | 4e852beed7173fa68f645b276edc9b1895b3a026 | [
"MIT"
] | null | null | null | src/utils/image.py | danifarre/pneumonia-detection | 4e852beed7173fa68f645b276edc9b1895b3a026 | [
"MIT"
] | null | null | null | src/utils/image.py | danifarre/pneumonia-detection | 4e852beed7173fa68f645b276edc9b1895b3a026 | [
"MIT"
] | null | null | null | from lime import lime_image
from skimage.segmentation import mark_boundaries
class Image(object):
@staticmethod
def explainer(images, model, image_size):
output = list()
for image in images:
explainer = lime_image.LimeImageExplainer(random_state=42)
explanation = expl... | 28.074074 | 71 | 0.575198 | from lime import lime_image
from skimage.segmentation import mark_boundaries
class Image(object):
@staticmethod
def explainer(images, model, image_size):
output = list()
for image in images:
explainer = lime_image.LimeImageExplainer(random_state=42)
explanation = expl... | true | true |
f74c7f34779201cbb89dd444eee8ccf075f682fe | 645 | py | Python | codegen/python/fixtures/method/special_chars/client/__init__.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | codegen/python/fixtures/method/special_chars/client/__init__.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | codegen/python/fixtures/method/special_chars/client/__init__.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | # DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
from .escape_type_service import Escape_typeService
from .http_client import HTTPClient
from .uri_service import UriService
from .User2_0 import User2_0
BASE_URI = "http://localhost:5000"
class Client:
"""
auto-generated. don't ... | 25.8 | 79 | 0.708527 |
from .escape_type_service import Escape_typeService
from .http_client import HTTPClient
from .uri_service import UriService
from .User2_0 import User2_0
BASE_URI = "http://localhost:5000"
class Client:
@staticmethod
def _get_services():
return ("escape_type", "uri")
def __init__(self, base_ur... | true | true |
f74c8009ca3882c06b6d0bfb2d4e80102a8a9918 | 8,323 | py | Python | test/python/transpiler/test_collect_2q_blocks.py | Elliot-Coupe/qiskit-terra | 8a604e156ba4c2fa099b1c24cd941f59b9408398 | [
"Apache-2.0"
] | 1 | 2021-06-09T11:22:21.000Z | 2021-06-09T11:22:21.000Z | test/python/transpiler/test_collect_2q_blocks.py | Elliot-Coupe/qiskit-terra | 8a604e156ba4c2fa099b1c24cd941f59b9408398 | [
"Apache-2.0"
] | 1 | 2019-10-03T12:22:41.000Z | 2019-10-03T12:22:41.000Z | test/python/transpiler/test_collect_2q_blocks.py | Elliot-Coupe/qiskit-terra | 8a604e156ba4c2fa099b1c24cd941f59b9408398 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.875 | 100 | 0.490448 |
import unittest
from math import pi
from ddt import ddt, data, unpack
from qiskit.circuit import Gate, QuantumCircuit
from qiskit.circuit import QuantumRegister, ClassicalRegister
from qiskit.converters import circuit_to_dag
from qiskit.transpiler import PassManager
from qiskit.transpiler.passes import C... | true | true |
f74c807978dfacd5e5ebfa01984d8b59c8a30854 | 15,044 | py | Python | travel/docs/Amadeus-master/pactravel-master/swagger_client/models/hotel_property_response.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | null | null | null | travel/docs/Amadeus-master/pactravel-master/swagger_client/models/hotel_property_response.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | 1 | 2021-06-01T22:04:28.000Z | 2021-06-01T22:04:28.000Z | travel/docs/Amadeus-master/pactravel-master/swagger_client/models/hotel_property_response.py | shopglobal/api | 176e1858d3f93e8e7854ba194698b6b9825841da | [
"CC-BY-4.0"
] | null | null | null | # coding: utf-8
"""
Amadeus Travel Innovation Sandbox
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import ... | 34.583908 | 356 | 0.63979 |
from pprint import pformat
from six import iteritems
import re
class HotelPropertyResponse(object):
swagger_types = {
'property_code': 'str',
'property_name': 'str',
'location': 'Geolocation',
'address': 'Address',
'total_price': 'Amount',
'min_daily_rate': 'A... | true | true |
f74c80bbe586c52e4f8909ede1e5c969737ecd1d | 2,576 | py | Python | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/mega_case_study.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/mega_case_study.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/mega_case_study.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | # Mega Case Study - Make a Hybrid Deep Learning Model
# Part 1 - Identify the Frauds with the Self-Organizing Map
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Credit_Card_Applications.csv')
X = dataset.iloc[:, :-1].v... | 27.698925 | 101 | 0.712345 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Credit_Card_Applications.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range = (0, 1))
X = sc.fit_transform(X)
from m... | true | true |
f74c8158f85e714a316144224e9a707d1deded4e | 1,689 | py | Python | tests/Advanced/typeof-vardecl-udt.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 13 | 2021-07-23T00:11:20.000Z | 2022-02-09T07:59:20.000Z | tests/Advanced/typeof-vardecl-udt.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 10 | 2021-09-14T12:12:22.000Z | 2022-03-30T21:27:10.000Z | tests/Advanced/typeof-vardecl-udt.py | aws-lumberyard-dev/o3de-azslc | bafacbe822da625da22ceba09e8fcdcf18d8d09b | [
"Apache-2.0",
"MIT"
] | 5 | 2021-07-19T23:49:51.000Z | 2021-12-02T05:13:35.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import sys
import os
from clr import *
sys.path.append("..")
import te... | 35.1875 | 106 | 0.647128 |
import sys
import os
from clr import *
sys.path.append("..")
import testfuncs
def test(thefile, compilerPath, silent):
symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent)
if ok:
try:
ok = symbols["Symbol '/g_s'"]['kind'] == 'Variable'
ok = ok and symbols[... | true | true |
f74c8247ef9fd9d46d2921cdaca7f41f0dec4c22 | 1,443 | py | Python | build/lib/adam/templates/french.py | NateveLang/Adam | 172e512e0d66003ed81730917f2d351271e47611 | [
"MIT"
] | 6 | 2021-11-18T14:34:41.000Z | 2021-12-26T18:43:20.000Z | nate/templates/french.py | NateveLang/Nate | 1714ecaf7b8ebd62daf060c7ea85444916d24091 | [
"MIT"
] | 7 | 2021-11-24T07:04:09.000Z | 2022-03-09T11:32:22.000Z | nate/templates/french.py | NateveLang/Nate | 1714ecaf7b8ebd62daf060c7ea85444916d24091 | [
"MIT"
] | 1 | 2021-11-29T08:49:23.000Z | 2021-11-29T08:49:23.000Z | transpiler_name = "adam"
mayusc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet = mayusc + mayusc.lower() + "_"
digits = "0123456789"
alphanum = alphabet + digits
blanks = "/t /n"
strings = ["'", '"', '"""', "'''"]
matrices = "$"
vectors = "[]"
embedded = "#"
commentaries = "~"
floating = "."
one_char_symbols = "+-*/%=<>()[]{... | 24.05 | 72 | 0.62578 | transpiler_name = "adam"
mayusc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet = mayusc + mayusc.lower() + "_"
digits = "0123456789"
alphanum = alphabet + digits
blanks = "/t /n"
strings = ["'", '"', '"""', "'''"]
matrices = "$"
vectors = "[]"
embedded = "#"
commentaries = "~"
floating = "."
one_char_symbols = "+-*/%=<>()[]{... | true | true |
f74c825c44d0c5c7c6bae90b4a9fd47139e25f5e | 657 | py | Python | skfem/generic_utils.py | gatling-nrl/scikit-fem | 04730d80d612470b7e802eed4c21dd96b89cef61 | [
"BSD-3-Clause"
] | null | null | null | skfem/generic_utils.py | gatling-nrl/scikit-fem | 04730d80d612470b7e802eed4c21dd96b89cef61 | [
"BSD-3-Clause"
] | 3 | 2022-01-07T00:56:47.000Z | 2022-01-12T20:06:34.000Z | skfem/generic_utils.py | gatling-nrl/scikit-fem | 04730d80d612470b7e802eed4c21dd96b89cef61 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy import ndarray
def hash_args(*args):
"""Return a tuple of hashes, with numpy support."""
return tuple(hash(arg.tobytes())
if isinstance(arg, ndarray)
else hash(arg) for arg in args)
class OrientedBoundary(ndarray):
"""An array of facet ind... | 25.269231 | 55 | 0.601218 | import numpy as np
from numpy import ndarray
def hash_args(*args):
return tuple(hash(arg.tobytes())
if isinstance(arg, ndarray)
else hash(arg) for arg in args)
class OrientedBoundary(ndarray):
def __new__(cls, indices, ori):
obj = np.asarray(indices).view(cls)
... | true | true |
f74c83389266bb17e3b51417cea4b6a7c13da262 | 1,068 | py | Python | test/ext/restapi/resources.py | YakovBoiev/test | 03143082978d10f048578089da10a0263c98383e | [
"Unlicense"
] | null | null | null | test/ext/restapi/resources.py | YakovBoiev/test | 03143082978d10f048578089da10a0263c98383e | [
"Unlicense"
] | null | null | null | test/ext/restapi/resources.py | YakovBoiev/test | 03143082978d10f048578089da10a0263c98383e | [
"Unlicense"
] | null | null | null | from flask import abort, jsonify
from flask_restful import Resource
from flask_simplelogin import login_required
from test.models import Product
class ProductResource(Resource):
def get(self):
products = Product.query.all() or abort(204)
return jsonify(
{"products": [product.to_dict()... | 29.666667 | 78 | 0.657303 | from flask import abort, jsonify
from flask_restful import Resource
from flask_simplelogin import login_required
from test.models import Product
class ProductResource(Resource):
def get(self):
products = Product.query.all() or abort(204)
return jsonify(
{"products": [product.to_dict()... | true | true |
f74c83762f9048d5189f885ce174c9769e767e6d | 300 | py | Python | Mundo 1/aula08a.py | lucashsbarros/Python_Curso | 01f7b5c89636cacc774d38b39951ac2b73272c63 | [
"MIT"
] | null | null | null | Mundo 1/aula08a.py | lucashsbarros/Python_Curso | 01f7b5c89636cacc774d38b39951ac2b73272c63 | [
"MIT"
] | null | null | null | Mundo 1/aula08a.py | lucashsbarros/Python_Curso | 01f7b5c89636cacc774d38b39951ac2b73272c63 | [
"MIT"
] | null | null | null | '''
from math import sqrt, floor
num = int(input('Digite um número: '))
raiz = sqrt(num)
print('A raiz de {} é igual a {:.2f}'.format(num,floor(raiz)))
'''
'''
import random
num = random.randint(1, 10)
print(num)'''
import emoji
print(emoji.emojize('Olá, Mundo :earth_americas:', use_aliases=True)) | 21.428571 | 69 | 0.673333 |
import emoji
print(emoji.emojize('Olá, Mundo :earth_americas:', use_aliases=True)) | true | true |
f74c869cab2a7c2ee30863c9f5398180ca79186c | 1,002 | py | Python | misc/google_cloud.py | Jason-George/irn | b75441b5fb8080c1dbd8dbcb9b05720a4ceb2246 | [
"MIT"
] | null | null | null | misc/google_cloud.py | Jason-George/irn | b75441b5fb8080c1dbd8dbcb9b05720a4ceb2246 | [
"MIT"
] | null | null | null | misc/google_cloud.py | Jason-George/irn | b75441b5fb8080c1dbd8dbcb9b05720a4ceb2246 | [
"MIT"
] | null | null | null | from google.cloud import storage
def upload_blob(bucket_name, source_file_name, destination_blob_name):
storage_client = storage.Client('liquid-force-295404')
"""Uploads a file to the bucket. https://cloud.google.com/storage/docs/ """
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.blob(d... | 47.714286 | 108 | 0.757485 | from google.cloud import storage
def upload_blob(bucket_name, source_file_name, destination_blob_name):
storage_client = storage.Client('liquid-force-295404')
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.blob(destination_blob_name)
blob.upload_from_filename(source_file_name)
print(... | true | true |
f74c87813a82e0b8fcaad6fa88479e5ed5ff3c27 | 3,572 | py | Python | utilize/__main__.py | copyrighthero/pypi.utilize | a289d04c18a1323725544e64825e11922cfbe81a | [
"BSD-2-Clause"
] | 2 | 2018-03-22T04:41:09.000Z | 2018-12-31T09:37:12.000Z | utilize/__main__.py | copyrighthero/pypi.utilize | a289d04c18a1323725544e64825e11922cfbe81a | [
"BSD-2-Clause"
] | null | null | null | utilize/__main__.py | copyrighthero/pypi.utilize | a289d04c18a1323725544e64825e11922cfbe81a | [
"BSD-2-Clause"
] | null | null | null | # Author: Hansheng Zhao <copyrighthero@gmail.com> (https://www.zhs.me)
from configparser import RawConfigParser
from argparse import ArgumentParser
def create_config(file_path):
# create config parser instance
configparser = RawConfigParser(allow_no_value = True)
# create required sections
configparser.add_... | 33.074074 | 88 | 0.652016 |
from configparser import RawConfigParser
from argparse import ArgumentParser
def create_config(file_path):
configparser = RawConfigParser(allow_no_value = True)
configparser.add_section('global')
configparser.add_section('basecon')
configparser.add_section('seco')
configparser.add_section('redis')
... | true | true |
f74c89fd1e7dbda84eadcb32bcf18df5fe1f5ca5 | 353 | py | Python | tests/test_app/urls.py | wullerot/django-filebase | 21a3bf7a6749afc6760e6c57707be1b43feb344d | [
"MIT"
] | null | null | null | tests/test_app/urls.py | wullerot/django-filebase | 21a3bf7a6749afc6760e6c57707be1b43feb344d | [
"MIT"
] | 9 | 2019-03-10T13:06:01.000Z | 2021-06-10T21:26:53.000Z | tests/test_app/urls.py | wullerot/django-filebase | 21a3bf7a6749afc6760e6c57707be1b43feb344d | [
"MIT"
] | 4 | 2019-04-11T09:33:35.000Z | 2019-12-14T00:47:32.000Z | """URLs to run the tests."""
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.views import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += [
url(r'^media/(?P<path>.*)$', static.serve, {'document... | 23.533333 | 93 | 0.685552 | from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.views import static
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += [
url(r'^media/(?P<path>.*)$', static.serve, {'document_root': settings.MEDIA_ROOT})... | true | true |
f74c8a3ad7f17e05c51f44e353ea6434f0d14b6b | 8,582 | py | Python | python/setupcache_test.py | danielforgacs/houdini_tools | b23f2b13baac6881da7e8f0cbb421fde3fc616ce | [
"MIT"
] | 2 | 2017-07-07T08:48:43.000Z | 2020-05-01T10:45:58.000Z | python/setupcache_test.py | danielforgacs/houdini_tools | b23f2b13baac6881da7e8f0cbb421fde3fc616ce | [
"MIT"
] | null | null | null | python/setupcache_test.py | danielforgacs/houdini_tools | b23f2b13baac6881da7e8f0cbb421fde3fc616ce | [
"MIT"
] | 2 | 2017-07-07T08:48:44.000Z | 2019-08-22T05:42:35.000Z | """
tests for cache setup module
"""
import unittest
import random
import hou
import setupcache
reload(setupcache)
class HipTest(unittest.TestCase):
"""
base class to initiate empty houdini scene
across tests with a basic node network
"""
def setUp(self):
hou.hipFile.clear(suppress_save... | 34.465863 | 89 | 0.663249 |
import unittest
import random
import hou
import setupcache
reload(setupcache)
class HipTest(unittest.TestCase):
def setUp(self):
hou.hipFile.clear(suppress_save_prompt=True)
geo = hou.node('/obj').createNode('geo', 'TEST_geo')
geo.node('file1').destroy()
name = ''. join([rando... | true | true |
f74c8b6d185483e535dc51a39a196c49f414a09e | 12,297 | py | Python | stanza/models/parser.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 3,633 | 2016-01-21T17:29:13.000Z | 2022-03-31T13:36:47.000Z | stanza/models/parser.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 593 | 2016-01-19T07:16:05.000Z | 2022-03-31T20:23:58.000Z | stanza/models/parser.py | asears/stanza | f91ca215e175d4f7b202259fe789374db7829395 | [
"Apache-2.0"
] | 525 | 2016-01-20T03:22:19.000Z | 2022-03-24T05:51:56.000Z | """
Entry point for training and evaluating a dependency parser.
This implementation combines a deep biaffine graph-based parser with linearization and distance features.
For details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf.
"""
"""
Training and evaluation for the parser.
"""
import s... | 43.452297 | 211 | 0.667561 |
import sys
import os
import shutil
import time
import argparse
import logging
import numpy as np
import random
import torch
from torch import nn, optim
import stanza.models.depparse.data as data
from stanza.models.depparse.data import DataLoader
from stanza.models.depparse.trainer import Trainer
from stanza.models.d... | true | true |
f74c8d9694f3bed1e51928a24b4ed2869f6f4dda | 22,314 | py | Python | arcade/tilemap.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | arcade/tilemap.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | arcade/tilemap.py | thecodinghyrax/arcade | 3d38ab42ce06e737f48240223484aa7706ffa11c | [
"MIT"
] | null | null | null | """
Functions and classes for managing a map saved in the .tmx format.
Typically these .tmx maps are created using the `Tiled Map Editor`_.
For more information, see the `Platformer Tutorial`_.
.. _Tiled Map Editor: https://www.mapeditor.org/
.. _Platformer Tutorial: http://arcade.academy/examples/platform_tutorial/... | 39.846429 | 116 | 0.586045 |
from typing import Optional, List, cast, Union
import math
import copy
import pytiled_parser
import os
from pathlib import Path
from arcade import Sprite
from arcade import AnimatedTimeBasedSprite
from arcade import AnimationKeyframe
from arcade import SpriteList
from arcade import load_texture
from arcade.arcade_typ... | true | true |
f74c8edfbd3cff6681cd978c994a851099e0e313 | 718 | py | Python | japan_weather_spider/weather.py | Cynthia7979/tools-programs | 0bf0b8bf33205c11d584b216d35c1ca3d23f04f2 | [
"MIT"
] | 2 | 2021-02-09T15:58:29.000Z | 2021-10-08T04:34:51.000Z | japan_weather_spider/weather.py | Cynthia7979/tools-programs | 0bf0b8bf33205c11d584b216d35c1ca3d23f04f2 | [
"MIT"
] | null | null | null | japan_weather_spider/weather.py | Cynthia7979/tools-programs | 0bf0b8bf33205c11d584b216d35c1ca3d23f04f2 | [
"MIT"
] | null | null | null | import requests
import pprint
from bs4 import BeautifulSoup as bsoup
year = 2019
month = 12
url = f"http://www.data.jma.go.jp/obd/stats/etrn/view/daily_s1.php?prec_no=44&block_no=47662&year={year}&month={month}"
html = requests.get(url).content
soup = bsoup(html, "html.parser", from_encoding="utf-8")
table = ... | 32.636364 | 120 | 0.577994 | import requests
import pprint
from bs4 import BeautifulSoup as bsoup
year = 2019
month = 12
url = f"http://www.data.jma.go.jp/obd/stats/etrn/view/daily_s1.php?prec_no=44&block_no=47662&year={year}&month={month}"
html = requests.get(url).content
soup = bsoup(html, "html.parser", from_encoding="utf-8")
table = ... | true | true |
f74c8eee51b1608c9eca69d71c74520c5284fac2 | 2,891 | py | Python | demo/World population.pct.py | st--/jupytext | f8e8352859cc22e17b11154d0770fd946c4a430a | [
"MIT"
] | 5,378 | 2018-09-01T22:03:43.000Z | 2022-03-31T06:51:42.000Z | demo/World population.pct.py | royalosyin/jupytext | 72aa6c4968da714323fbd7a7c548ee4b1274c946 | [
"MIT"
] | 812 | 2018-08-31T08:26:13.000Z | 2022-03-30T18:12:11.000Z | demo/World population.pct.py | royalosyin/jupytext | 72aa6c4968da714323fbd7a7c548ee4b1274c946 | [
"MIT"
] | 380 | 2018-09-02T01:40:07.000Z | 2022-03-25T13:57:23.000Z | # ---
# jupyter:
# jupytext:
# cell_markers: region,endregion
# formats: ipynb,.pct.py:percent,.lgt.py:light,.spx.py:sphinx,md,Rmd,.pandoc.md:pandoc
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.1.0
# kernelspec:
# ... | 25.8125 | 90 | 0.666551 |
isplay.max_columns = 20
wb.search_indicators('Population, total')
indicators = {'SP.POP.TOTL': 'Population, total',
'AG.SRF.TOTL.K2': 'Surface area (sq. km)',
'AG.LND.TOTL.K2': 'Land area (sq. km)',
'AG.LND.ARBL.ZS': 'Arable land (% of land area)... | true | true |
f74c929a62c255e9f5ec06a22a0f58d3a5860845 | 17,287 | py | Python | opurtbot-remote.py | nathan-yan/opurtbot | 01a50604366990ab0b7ca52350e597b2165fbd0a | [
"MIT"
] | null | null | null | opurtbot-remote.py | nathan-yan/opurtbot | 01a50604366990ab0b7ca52350e597b2165fbd0a | [
"MIT"
] | null | null | null | opurtbot-remote.py | nathan-yan/opurtbot | 01a50604366990ab0b7ca52350e597b2165fbd0a | [
"MIT"
] | null | null | null | import discord
from discord.ext import tasks, commands
import asyncio
import socketio
import threading
import subprocess
import time
from queue import Queue, Empty
from threading import Thread
from requests import get
import os
import re
import boto3
import utils
client = boto3.client('ec2')
chat_reg = re.comp... | 35.279592 | 288 | 0.534737 | import discord
from discord.ext import tasks, commands
import asyncio
import socketio
import threading
import subprocess
import time
from queue import Queue, Empty
from threading import Thread
from requests import get
import os
import re
import boto3
import utils
client = boto3.client('ec2')
chat_reg = re.comp... | true | true |
f74c92d29eac9e1434ab1cdb1dc97c64e3fdeaf6 | 21,451 | py | Python | woolnote/html_page_templates.py | SvobodaJakub/woolnote | 463cfb2975f9012dbe118a18582c07d0b9b9fba3 | [
"MIT"
] | null | null | null | woolnote/html_page_templates.py | SvobodaJakub/woolnote | 463cfb2975f9012dbe118a18582c07d0b9b9fba3 | [
"MIT"
] | null | null | null | woolnote/html_page_templates.py | SvobodaJakub/woolnote | 463cfb2975f9012dbe118a18582c07d0b9b9fba3 | [
"MIT"
] | null | null | null | # University of Illinois/NCSA Open Source License
# Copyright (c) 2018, Jakub Svoboda.
# TODO: docstring for the file
import hashlib
import os
from woolnote import systemencoding
from woolnote import util
from woolnote import html_page_templates_pres
from woolnote import config
from woolnote import tests
@tests.i... | 42.477228 | 186 | 0.703464 |
import hashlib
import os
from woolnote import systemencoding
from woolnote import util
from woolnote import html_page_templates_pres
from woolnote import config
from woolnote import tests
@tests.integration_function("html_page_templates")
def folder_tag_etc_list(action_name, req_elem_name, elem_list=None, elem... | true | true |
f74c92eba9c0819400578be5de0a409024cd2293 | 637 | py | Python | backend/manage.py | crowdbotics-apps/test-mobile-33934 | a919efe0fc152dbc3cbdf4bd42a19bb8b7770bc8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/test-mobile-33934 | a919efe0fc152dbc3cbdf4bd42a19bb8b7770bc8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/test-mobile-33934 | a919efe0fc152dbc3cbdf4bd42a19bb8b7770bc8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_mobile_33934.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
ra... | 28.954545 | 81 | 0.687598 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_mobile_33934.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed a... | true | true |
f74c93fc3f4203663c1f8844aa8b87716d8ecd91 | 6,577 | py | Python | contrib/HumanSeg/nets/libs.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2021-01-31T02:19:12.000Z | 2022-03-12T12:39:21.000Z | contrib/HumanSeg/nets/libs.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-21T02:36:01.000Z | 2021-07-21T02:37:45.000Z | contrib/HumanSeg/nets/libs.py | windstamp/PaddleSeg | 828808ea306adf2e8b94c291b77e7b7cf558bc2a | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2021-02-03T11:18:36.000Z | 2022-03-07T08:18:53.000Z | # coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# 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 requ... | 29.895455 | 79 | 0.584765 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
import paddle.fluid as fluid
import contextlib
bn_regularizer = fluid.regularizer.L2DecayRegularizer(regularization_coeff=0.0)
name_scope = ""
@contextlib.contextmanager
def scope... | true | true |
f74c943fc2088ff149d2882fd0824b169dd9c870 | 695 | py | Python | zigmond/consts.py | vertolab/zigmond | f9ad676e1ef391e4dd9b7154a444e2cf4809caf1 | [
"Apache-2.0"
] | null | null | null | zigmond/consts.py | vertolab/zigmond | f9ad676e1ef391e4dd9b7154a444e2cf4809caf1 | [
"Apache-2.0"
] | null | null | null | zigmond/consts.py | vertolab/zigmond | f9ad676e1ef391e4dd9b7154a444e2cf4809caf1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 Verto Lab LLC
#
# 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.611111 | 77 | 0.729496 |
ENDPOINT = 'https://zig.vertolab.com/trace'
APP_KEY_ENV_VAR_NAME = 'ZIGMOND_APP_KEY'
| true | true |
f74c94502710c42af9acf6c7159396503a7d570f | 71,926 | py | Python | api.py | fossabot/NewApp-Flask | 20c871feea0b0ae75466706c4cbb0f53bccbc7d0 | [
"MIT"
] | 1 | 2020-05-15T09:38:06.000Z | 2020-05-15T09:38:06.000Z | api.py | fossabot/NewApp-Flask | 20c871feea0b0ae75466706c4cbb0f53bccbc7d0 | [
"MIT"
] | 6 | 2020-04-12T18:09:16.000Z | 2022-01-13T02:18:01.000Z | api.py | fossabot/NewApp-Flask | 20c871feea0b0ae75466706c4cbb0f53bccbc7d0 | [
"MIT"
] | 1 | 2020-03-12T00:40:09.000Z | 2020-03-12T00:40:09.000Z | import datetime
import calendar
import httpagentparser
from flask import Blueprint, make_response, jsonify, request, url_for, render_template
from models import PostModel, TagModel, LikeModel, ReplyModel, Analyze_Pages, UserModel, Ip_Coordinates, bcrypt, \
Notifications_Model, Subscriber, Analyze_Session
import d... | 38.217853 | 185 | 0.562189 | import datetime
import calendar
import httpagentparser
from flask import Blueprint, make_response, jsonify, request, url_for, render_template
from models import PostModel, TagModel, LikeModel, ReplyModel, Analyze_Pages, UserModel, Ip_Coordinates, bcrypt, \
Notifications_Model, Subscriber, Analyze_Session
import d... | true | true |
f74c95e0ad91941cbb153cd1bbf61ba4c0d6ffbc | 5,423 | py | Python | xpresso/binders/_body/openapi/form.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | null | null | null | xpresso/binders/_body/openapi/form.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | null | null | null | xpresso/binders/_body/openapi/form.py | dantownsend/xpresso | a4c4dbe96972a6f0339f30d7d794932f70510eea | [
"MIT"
] | null | null | null | import inspect
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 8):
from typing_extensions import Literal
else:
from typing import Literal
from di.typing import get_markers_from_parameter
from xpresso._utils.typing import model_field_from_param
from xpresso.binders._body.o... | 36.891156 | 85 | 0.650194 | import inspect
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 8):
from typing_extensions import Literal
else:
from typing import Literal
from di.typing import get_markers_from_parameter
from xpresso._utils.typing import model_field_from_param
from xpresso.binders._body.o... | true | true |
f74c95f96299cf132a9a1d8ab8b238a532e2695b | 130,123 | py | Python | tensorflow/contrib/rnn/python/ops/rnn_cell.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 5 | 2018-10-20T03:54:49.000Z | 2021-01-02T07:19:53.000Z | tensorflow/contrib/rnn/python/ops/rnn_cell.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 1 | 2018-09-04T07:44:56.000Z | 2018-09-04T07:44:56.000Z | tensorflow/contrib/rnn/python/ops/rnn_cell.py | Zwysilence/tensorflow | b55001be83da044bb21d539d433dec6231eaec55 | [
"Apache-2.0"
] | 2 | 2020-01-31T04:19:45.000Z | 2020-03-06T16:33:00.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.327835 | 88 | 0.665148 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
from tensorflow.contrib.compiler import jit
from tensorflow.contrib.layers.python.layers import layers
from tensorflow.contrib.rnn.python.ops import core_rnn_cell
f... | true | true |
f74c96d1cc3ce74c8f09455eba7a26476de86461 | 12,101 | py | Python | crime_db.py | aribasadme/CrimeDB | a16b35204921726ec6f3cf9a7ec5d9b51cbe7d49 | [
"MIT"
] | null | null | null | crime_db.py | aribasadme/CrimeDB | a16b35204921726ec6f3cf9a7ec5d9b51cbe7d49 | [
"MIT"
] | null | null | null | crime_db.py | aribasadme/CrimeDB | a16b35204921726ec6f3cf9a7ec5d9b51cbe7d49 | [
"MIT"
] | null | null | null | import pandas as pd
from police_api import PoliceAPI
def first_job(api, dates, t_current):
"""
Creates the tables and populates them with the historical data
from T_0
to T_current
"""
# subset of dates
dates_hist = dates[dates <= t_current]
# crime_categories table
s_crime_c... | 44.488971 | 150 | 0.685563 | import pandas as pd
from police_api import PoliceAPI
def first_job(api, dates, t_current):
dates_hist = dates[dates <= t_current]
s_crime_cat = set()
for date in dates_hist:
s_crime_cat.update(api.get_crime_categories(date))
crime_categories['id'] = [c.url for c in s_crime_cat]
... | true | true |
f74c9840a9a64fa6083f2197663aa0e29d22fa12 | 786 | py | Python | strawberry/file_uploads/data.py | nyejon/strawberry | 664fde292fe2186c3e33e8cae79964b866fa5822 | [
"MIT"
] | 1 | 2021-05-26T18:31:11.000Z | 2021-05-26T18:31:11.000Z | strawberry/file_uploads/data.py | nyejon/strawberry | 664fde292fe2186c3e33e8cae79964b866fa5822 | [
"MIT"
] | 1 | 2021-01-18T18:58:45.000Z | 2021-01-18T19:39:09.000Z | strawberry/file_uploads/data.py | nyejon/strawberry | 664fde292fe2186c3e33e8cae79964b866fa5822 | [
"MIT"
] | null | null | null | from typing import Any, Dict, List, Mapping
def replace_placeholders_with_files(
operations: Dict[str, Any],
files_map: Dict[str, List[str]],
files: Mapping[str, Any],
) -> Dict[str, Any]:
path_to_key_iter = (
(value.split("."), key)
for (key, values) in files_map.items()
for v... | 23.117647 | 85 | 0.642494 | from typing import Any, Dict, List, Mapping
def replace_placeholders_with_files(
operations: Dict[str, Any],
files_map: Dict[str, List[str]],
files: Mapping[str, Any],
) -> Dict[str, Any]:
path_to_key_iter = (
(value.split("."), key)
for (key, values) in files_map.items()
for v... | true | true |
f74c985afe522c12b7250d7d45db3737eb3fcf24 | 3,666 | py | Python | maptrainer/model/LinRNNModel.py | mothguib/maptrainer | 335334fed073f8d14a4c5137eaa0424efcbcac63 | [
"MIT"
] | null | null | null | maptrainer/model/LinRNNModel.py | mothguib/maptrainer | 335334fed073f8d14a4c5137eaa0424efcbcac63 | [
"MIT"
] | null | null | null | maptrainer/model/LinRNNModel.py | mothguib/maptrainer | 335334fed073f8d14a4c5137eaa0424efcbcac63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import torch
from torch import autograd
from torch.autograd import Variable
import torch.nn as nn
from maptrainer.model.MAPModel import MAPModel
from ..data import INIT_RANGE_BOUND
class LinRNNModel(MAPModel):
"""
`LinRNNModel`: Linear-output RNN model
Contain... | 33.027027 | 77 | 0.562739 |
import numpy as np
import torch
from torch import autograd
from torch.autograd import Variable
import torch.nn as nn
from maptrainer.model.MAPModel import MAPModel
from ..data import INIT_RANGE_BOUND
class LinRNNModel(MAPModel):
def __init__(self,
n_input,
_n_hid,
... | true | true |
f74c992e1f453e0771df3cb5998caeb4ce836e78 | 1,701 | py | Python | tests/unit/elastic/test_Save_To_ELK.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | tests/unit/elastic/test_Save_To_ELK.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | tests/unit/elastic/test_Save_To_ELK.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | import datetime
import unittest
from time import sleep
from unittest import TestCase
from pbx_gs_python_utils.utils.Dev import Dev
from gw_bot.elastic.Save_To_ELK import Save_To_ELK
from gw_bot.helpers.Test_Helper import Test_Helper
class Test_Save_To_ELK(Test_Helper):
def setUp(self):
super().setUp()
... | 32.711538 | 104 | 0.696061 | import datetime
import unittest
from time import sleep
from unittest import TestCase
from pbx_gs_python_utils.utils.Dev import Dev
from gw_bot.elastic.Save_To_ELK import Save_To_ELK
from gw_bot.helpers.Test_Helper import Test_Helper
class Test_Save_To_ELK(Test_Helper):
def setUp(self):
super().setUp()
... | true | true |
f74c99daa678a9859696b4db78d85ca3338134fd | 7,442 | py | Python | accelbyte_py_sdk/api/iam/operations/users/create_user.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/iam/operations/users/create_user.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/iam/operations/users/create_user.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 26.963768 | 147 | 0.629535 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HeaderStr
from .....core import HttpResponse
from ...models import ModelUserCreateRequest
from ...models import ModelUserCreateResponse
class Cr... | true | true |
f74c9a5d66b76d3b4a97d6ce5a917b6658b44c98 | 545 | py | Python | entries/migrations/0001_initial.py | sourcificer/NotesAhoy | fa6383a78c88ad53a7291eb2cea0d03631442cb1 | [
"MIT"
] | null | null | null | entries/migrations/0001_initial.py | sourcificer/NotesAhoy | fa6383a78c88ad53a7291eb2cea0d03631442cb1 | [
"MIT"
] | 5 | 2021-04-08T22:03:09.000Z | 2022-02-10T10:41:07.000Z | entries/migrations/0001_initial.py | sourcificer/NotesAhoy | fa6383a78c88ad53a7291eb2cea0d03631442cb1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-10 08:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(au... | 23.695652 | 114 | 0.570642 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fa... | true | true |
f74c9c9983e5d07467273f00e60a4689ab4f99c6 | 726 | py | Python | djview/urls.py | rklabs/djaaks | 4f7ab22333b0022226d18a1bb913377cae1346b1 | [
"MIT"
] | null | null | null | djview/urls.py | rklabs/djaaks | 4f7ab22333b0022226d18a1bb913377cae1346b1 | [
"MIT"
] | null | null | null | djview/urls.py | rklabs/djaaks | 4f7ab22333b0022226d18a1bb913377cae1346b1 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from djview import views
urlpatterns = [
url(r'^$', views.djview_index, name='djview_index'),
url(r'^about/', views.djview_about, name='djview_about'),
url(r'^add_category/', views.add_category, name='add_category'),
url(r'^category/(?P<category_name_slug>[\w\-]+)/$', v... | 40.333333 | 71 | 0.644628 | from django.conf.urls import url
from djview import views
urlpatterns = [
url(r'^$', views.djview_index, name='djview_index'),
url(r'^about/', views.djview_about, name='djview_about'),
url(r'^add_category/', views.add_category, name='add_category'),
url(r'^category/(?P<category_name_slug>[\w\-]+)/$', v... | true | true |
f74c9d49e33ab6145fd55c2d6a632fb4c698a4ec | 144 | py | Python | python/fac-bench.py | robindaumann/fac-bench | 57d040514bdd541308c44b831c631fc16e20f026 | [
"MIT"
] | 2 | 2019-08-19T17:33:01.000Z | 2019-12-31T16:36:08.000Z | python/fac-bench.py | robindaumann/fac-bench | 57d040514bdd541308c44b831c631fc16e20f026 | [
"MIT"
] | 4 | 2019-12-31T21:01:32.000Z | 2020-08-24T09:43:11.000Z | python/fac-bench.py | robindaumann/fac-bench | 57d040514bdd541308c44b831c631fc16e20f026 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import math
def fac_bench(n):
return sum(math.factorial(i) for i in range(1, n))
print(fac_bench(3001), end='')
| 13.090909 | 54 | 0.666667 |
import math
def fac_bench(n):
return sum(math.factorial(i) for i in range(1, n))
print(fac_bench(3001), end='')
| true | true |
f74c9e1be7ed6ac6a309b39d72ce0fc300304ed4 | 584 | py | Python | Handlers/MTTAESHandler.py | waitwalker/PetAPI | 709cbf9bb0ecfaef5897b3662b87ecfef3ca81b7 | [
"MIT"
] | 10 | 2019-05-15T09:14:51.000Z | 2019-12-21T12:02:53.000Z | Handlers/MTTAESHandler.py | TieriaDM/PetAPI | 709cbf9bb0ecfaef5897b3662b87ecfef3ca81b7 | [
"MIT"
] | null | null | null | Handlers/MTTAESHandler.py | TieriaDM/PetAPI | 709cbf9bb0ecfaef5897b3662b87ecfef3ca81b7 | [
"MIT"
] | 6 | 2019-05-17T11:32:38.000Z | 2021-08-31T05:16:02.000Z | # -*- coding: utf-8 -*-
# @Time : 2018/7/9 上午10:41
# @Author : waitWalker
# @Email : waitwalker@163.com
# @File : MTTAESHandler.py
# @Software: PyCharm
from Handlers import MTTBaseHandler
from Security import MTTSecurityManager
from Crypto.Cipher import AES
class MTTAESHandler(MTTBaseHandler.MTTBaseHandler):... | 20.857143 | 70 | 0.652397 |
from Handlers import MTTBaseHandler
from Security import MTTSecurityManager
from Crypto.Cipher import AES
class MTTAESHandler(MTTBaseHandler.MTTBaseHandler):
def get(self, *args, **kwargs):
pass
def post(self, *args, **kwargs):
para = self.get_argument('encryption')
... | true | true |
f74c9e33fd93a4e7a72ae4a9d0aab764ad6e9dee | 4,189 | py | Python | tests/silk/test-complex.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | null | null | null | tests/silk/test-complex.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | 1 | 2021-04-06T09:08:39.000Z | 2021-04-06T09:10:02.000Z | tests/silk/test-complex.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | null | null | null | import sys
from pprint import pprint
from silk import Silk, ValidationError
def adder(self, other):
return other + self.x
s = Silk()
s.__add__ = adder
s.bla = adder
s.x = 80
print(s.x.data)
print(s.bla(5))
print(s+5)
s2 = Silk(schema=s.schema)
s2.x = 10
print(s2+5)
s3 = Silk(schema=s2.schema)
s3.x = 10
print(s3... | 18.213043 | 87 | 0.634519 | import sys
from pprint import pprint
from silk import Silk, ValidationError
def adder(self, other):
return other + self.x
s = Silk()
s.__add__ = adder
s.bla = adder
s.x = 80
print(s.x.data)
print(s.bla(5))
print(s+5)
s2 = Silk(schema=s.schema)
s2.x = 10
print(s2+5)
s3 = Silk(schema=s2.schema)
s3.x = 10
print(s3... | true | true |
f74c9f2e13bc9503f49feb82380d16d2a2529a16 | 320 | py | Python | drivers installation/chromedriver.py | ProjektVek/Spotify-Automation | 13c472c5e9da8b5a5a2178af6121237b69faaf2e | [
"MIT"
] | 1 | 2021-12-08T18:52:00.000Z | 2021-12-08T18:52:00.000Z | drivers installation/chromedriver.py | ProjektVek/Spotify-Automation | 13c472c5e9da8b5a5a2178af6121237b69faaf2e | [
"MIT"
] | null | null | null | drivers installation/chromedriver.py | ProjektVek/Spotify-Automation | 13c472c5e9da8b5a5a2178af6121237b69faaf2e | [
"MIT"
] | null | null | null | import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service('./drivers/chromedriver.exe')
service.start()
driver = webdriver.Remote(service.service_url)
driver.get('http://www.google.com/');
time.sleep(5) # Let the user actually see something!
driver.quit() | 18.823529 | 53 | 0.76875 | import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service('./drivers/chromedriver.exe')
service.start()
driver = webdriver.Remote(service.service_url)
driver.get('http://www.google.com/');
time.sleep(5)
driver.quit() | true | true |
f74ca009acbca48147e6194743570829574a4cf1 | 2,233 | py | Python | surirobot/core/api/stt.py | aberrier/ethera | caed5058a19db629942c847280204794da063319 | [
"MIT"
] | 2 | 2018-06-08T09:10:41.000Z | 2018-06-08T09:10:47.000Z | surirobot/core/api/stt.py | aberrier/ethera | caed5058a19db629942c847280204794da063319 | [
"MIT"
] | null | null | null | surirobot/core/api/stt.py | aberrier/ethera | caed5058a19db629942c847280204794da063319 | [
"MIT"
] | 1 | 2019-02-06T19:22:53.000Z | 2019-02-06T19:22:53.000Z | from .base import ApiCaller
from PyQt5.QtCore import pyqtSignal
from surirobot.core.common import State, ehpyqtSlot
import requests
import logging
import os
class SttApiCaller(ApiCaller):
"""
API class for STT API
https://github.com/suricats/surirobot-api-converse
"""
update_state = pyqtSignal(st... | 35.444444 | 136 | 0.56695 | from .base import ApiCaller
from PyQt5.QtCore import pyqtSignal
from surirobot.core.common import State, ehpyqtSlot
import requests
import logging
import os
class SttApiCaller(ApiCaller):
update_state = pyqtSignal(str, int, dict)
def __init__(self, url):
ApiCaller.__init__(self, url)
self.log... | true | true |
f74ca041c0481cef35df818e8a9f5d08bc568909 | 2,998 | py | Python | authentication/wampcra/static/backend.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | null | null | null | authentication/wampcra/static/backend.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | null | null | null | authentication/wampcra/static/backend.py | pawankaushal/crossbar-examples | b6e0cc321bad020045c4fafec091f78abd938618 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
##
## Copyright (C) Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
## 1.... | 40.513514 | 96 | 0.643095 | true | true | |
f74ca09a1fce9b6aae62e91cb1dce1ede654f925 | 8,564 | py | Python | replicator-schema-translation/docs/conf.py | Kaifee-Mohammad/examples | 74f5e923e24d8e2488939dc7f274a9e6ce802180 | [
"Apache-2.0"
] | null | null | null | replicator-schema-translation/docs/conf.py | Kaifee-Mohammad/examples | 74f5e923e24d8e2488939dc7f274a9e6ce802180 | [
"Apache-2.0"
] | null | null | null | replicator-schema-translation/docs/conf.py | Kaifee-Mohammad/examples | 74f5e923e24d8e2488939dc7f274a9e6ce802180 | [
"Apache-2.0"
] | 1 | 2020-04-30T12:05:14.000Z | 2020-04-30T12:05:14.000Z | # -*- coding: utf-8 -*-
#
# CP Demo documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 17 14:17:15 2014.
#
# 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.
#
# A... | 32.074906 | 79 | 0.71894 |
import sys
import os
extensions = ['sphinx.ext.ifconfig', 'sphinxcontrib.httpdomain']
def setup(app):
app.add_config_value('platform_docs', True, 'env')
platform_docs = False
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Schema Tran... | true | true |
f74ca0e0ac2e25950cc3867dc88c9211e2450a06 | 31,910 | py | Python | sklearn/feature_selection/_univariate_selection.py | jayzed82/scikit-learn | f52c0d441502117020ac0152cea8e89367f55ed6 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:43.000Z | 2021-11-19T06:21:43.000Z | sklearn/feature_selection/_univariate_selection.py | jayzed82/scikit-learn | f52c0d441502117020ac0152cea8e89367f55ed6 | [
"BSD-3-Clause"
] | 1 | 2021-07-09T15:13:59.000Z | 2021-07-09T15:13:59.000Z | sklearn/feature_selection/_univariate_selection.py | jayzed82/scikit-learn | f52c0d441502117020ac0152cea8e89367f55ed6 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:34.000Z | 2021-11-19T06:21:34.000Z | """Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | 34.647123 | 79 | 0.647728 |
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..preprocessing import LabelBinarizer
from ..utils import (as_float_array, check_array, check_X_y, safe_sqr,
safe_mask)
from ..utils.extmath import saf... | true | true |
f74ca0e4b20b83d509bc3a77fa6331062c311e10 | 3,577 | py | Python | localshop/apps/packages/utils.py | rcoup/localshop | b7d0803afd9335862accfc79dee047a6b0e67ad6 | [
"BSD-3-Clause"
] | null | null | null | localshop/apps/packages/utils.py | rcoup/localshop | b7d0803afd9335862accfc79dee047a6b0e67ad6 | [
"BSD-3-Clause"
] | null | null | null | localshop/apps/packages/utils.py | rcoup/localshop | b7d0803afd9335862accfc79dee047a6b0e67ad6 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import hashlib
import logging
import os
from django.core.files.uploadedfile import TemporaryUploadedFile
from django.db.models import FieldDoesNotExist
from django.db.models.fields.files import FileField
from django.http import QueryDict
from django.utils.datastructures import MultiValueDict
logger = l... | 29.808333 | 78 | 0.559966 | import inspect
import hashlib
import logging
import os
from django.core.files.uploadedfile import TemporaryUploadedFile
from django.db.models import FieldDoesNotExist
from django.db.models.fields.files import FileField
from django.http import QueryDict
from django.utils.datastructures import MultiValueDict
logger = l... | true | true |
f74ca22c8a9497b85f8a04088eb53863904a4e42 | 3,577 | py | Python | Tests/test_SeqIO_online.py | Manoo-hao/biopython | 5a55811d57880cbc9e6f198374e81ef3a4fbfa05 | [
"BSD-3-Clause"
] | 5 | 2015-06-14T17:01:57.000Z | 2020-10-05T03:27:56.000Z | Tests/test_SeqIO_online.py | Manoo-hao/biopython | 5a55811d57880cbc9e6f198374e81ef3a4fbfa05 | [
"BSD-3-Clause"
] | 1 | 2020-07-21T03:13:37.000Z | 2020-07-23T02:46:25.000Z | Tests/test_SeqIO_online.py | Manoo-hao/biopython | 5a55811d57880cbc9e6f198374e81ef3a4fbfa05 | [
"BSD-3-Clause"
] | 8 | 2016-02-20T22:53:21.000Z | 2022-02-04T06:10:23.000Z | # Copyright 2007-2010 by Peter Cock. All rights reserved.
# Revisions copyright 2007-2008 by Michiel de Hoon. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Testing online c... | 33.745283 | 86 | 0.617557 |
import unittest
import requires_internet
from Bio import Entrez
from Bio import ExPASy
from Bio import SeqIO
from Bio.SeqUtils.CheckSum import seguid
from Bio.SwissProt import SwissProtParserError
requires_internet.check()
Entrez.email = "biopython@biopython.org"
class ExPASyTests(unittest.TestCase):
... | true | true |
f74ca23cd541ac74f528d3ba865a222e9f867b59 | 5,217 | py | Python | tests/test_build.py | a-nau/pytorch3d | b0a83a291ffe11be5a553b7fd00cc5534b5f3c0f | [
"BSD-3-Clause"
] | 1 | 2022-03-30T19:52:34.000Z | 2022-03-30T19:52:34.000Z | tests/test_build.py | Xiangjun-Gao/pytorch3d | a9b0d50bafa26c4f2a9e665ff7b805face3f24e6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_build.py | Xiangjun-Gao/pytorch3d | a9b0d50bafa26c4f2a9e665ff7b805face3f24e6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import importlib
import json
import os
import sys
import unittest
import unittest.mock
from collections import Co... | 38.644444 | 92 | 0.609162 |
import importlib
import json
import os
import sys
import unittest
import unittest.mock
from collections import Counter
from common_testing import get_pytorch3d_dir
in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST"
in_re_worker = os.environ.get("INSIDE_RE_WORKER") is not None
class TestBuild... | true | true |
f74ca26d6211ef50263a7133212506d82ee54133 | 2,743 | py | Python | bin/libsw/image_magick.py | Rondore/sitewrangler | a67a140262281c1f6be48c55f86544e476d7d7b4 | [
"MIT"
] | null | null | null | bin/libsw/image_magick.py | Rondore/sitewrangler | a67a140262281c1f6be48c55f86544e476d7d7b4 | [
"MIT"
] | null | null | null | bin/libsw/image_magick.py | Rondore/sitewrangler | a67a140262281c1f6be48c55f86544e476d7d7b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os, subprocess
from libsw import builder, version
class ImageMagickBuilder(builder.AbstractGitBuilder):
def __init__(self, build_dir="/usr/local/src/", source_version=False):
super().__init__('image-magick', build_dir, source_version, branch="main")
def get_source_url(se... | 36.092105 | 145 | 0.587313 |
import os, subprocess
from libsw import builder, version
class ImageMagickBuilder(builder.AbstractGitBuilder):
def __init__(self, build_dir="/usr/local/src/", source_version=False):
super().__init__('image-magick', build_dir, source_version, branch="main")
def get_source_url(self):
return 'h... | true | true |
f74ca30c018ab695a3546d53999add3d08d50041 | 939 | py | Python | Problem Solving/Algorithms/Permuting Two Arrays.py | Muntaha-Islam0019/HackerRank-Solutions | caa687aab67461aba69026d3bdc44b62c1dec1c9 | [
"MIT"
] | null | null | null | Problem Solving/Algorithms/Permuting Two Arrays.py | Muntaha-Islam0019/HackerRank-Solutions | caa687aab67461aba69026d3bdc44b62c1dec1c9 | [
"MIT"
] | null | null | null | Problem Solving/Algorithms/Permuting Two Arrays.py | Muntaha-Islam0019/HackerRank-Solutions | caa687aab67461aba69026d3bdc44b62c1dec1c9 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'twoArrays' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. INTEGER k
# 2. INTEGER_ARRAY A
# 3. INTEGER_ARRAY B
#
def twoArrays(k, A, B):
# Write your co... | 18.411765 | 55 | 0.591054 |
import math
import os
import random
import re
import sys
def twoArrays(k, A, B):
A = sorted(A)
B = sorted(B, reverse=True)
for x, y in zip(A, B):
if x+y < k:
return "NO"
return "YES"
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
... | true | true |
f74ca54b54a2eb0395d0ae4734c4c1706aeda0c8 | 8,881 | py | Python | docs/conf.py | 1nf1n1ty08/funwithserverless | 5f8d67ca0470c1ce347b41719c14daa078819284 | [
"MIT"
] | 2 | 2019-04-18T13:21:20.000Z | 2019-04-18T13:38:08.000Z | docs/conf.py | 1nf1n1ty08/funwithserverless | 5f8d67ca0470c1ce347b41719c14daa078819284 | [
"MIT"
] | null | null | null | docs/conf.py | 1nf1n1ty08/funwithserverless | 5f8d67ca0470c1ce347b41719c14daa078819284 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# funwithserverless documentation build configuration file, created by
# sphinx-quickstart
#
# 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.
#
... | 30.730104 | 87 | 0.714897 |
import sys
import os
import sphinx_rtd_theme
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
import sphinx.apidoc
sphinx.apidoc.main(argv=['-f', '-o', os.path.join(project_root, 'docs'), project_root])
sys.path.insert(0, project_root)
import src
extensions = [
'sphinx.ext... | true | true |
f74ca5d0b9a3c3d2b5c5bef6cf7e1a8ed60865c8 | 5,733 | py | Python | cloudify_deployment_proxy/utils.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 8 | 2017-06-14T14:59:17.000Z | 2021-09-15T05:44:05.000Z | cloudify_deployment_proxy/utils.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 75 | 2017-04-20T20:42:26.000Z | 2022-02-16T11:03:02.000Z | cloudify_deployment_proxy/utils.py | jrzeszutek/cloudify-utilities-plugin | d62fc98e9164fd836d8f22a757b5a58ca119f97a | [
"Apache-2.0"
] | 21 | 2017-08-13T13:19:58.000Z | 2021-12-09T14:41:42.000Z | # Copyright (c) 2017-2018 Cloudify Platform Ltd. 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 ... | 33.331395 | 78 | 0.639107 |
import os
import sys
import shutil
import zipfile
import tempfile
from shutil import copy
import requests
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.exceptions import OperationRetry
from cloudify.utils import exception_to_error_cause
from cloudify_common_... | true | true |
f74ca70488ecc51a5d71e1df4ed3bc7adf1cbd26 | 1,323 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hltDiEG25CaloIdLHgcalHEUnseededFilter_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltDiEG25CaloIdLHgcalHEUnseededFilter_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltDiEG25CaloIdLHgcalHEUnseededFilter_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hltDiEG25CaloIdLHgcalHEUnseededFilter = cms.EDFilter("HLTEgammaGenericQuadraticEtaFilter",
absEtaLowEdges = cms.vdouble(0.0, 1.0, 1.479, 2.1),
candTag = cms.InputTag("hltDiEG25CaloIdLClusterShapeSigmavvUnseededFilter"),
doRhoCorrection = cms.bool(False),
effecti... | 40.090909 | 90 | 0.696901 | import FWCore.ParameterSet.Config as cms
hltDiEG25CaloIdLHgcalHEUnseededFilter = cms.EDFilter("HLTEgammaGenericQuadraticEtaFilter",
absEtaLowEdges = cms.vdouble(0.0, 1.0, 1.479, 2.1),
candTag = cms.InputTag("hltDiEG25CaloIdLClusterShapeSigmavvUnseededFilter"),
doRhoCorrection = cms.bool(False),
effecti... | true | true |
f74ca76d46ca77493abb18f4a461aaf5edf2cfa7 | 1,881 | py | Python | 52-54-feedparser/my-code-RSS-feeds/pull_xml.py | Anthlis/My_100_Days_Of_Python | 9bdc36075f633099bd70161ae19ffad7ab88a797 | [
"MIT"
] | 2 | 2020-11-15T12:44:01.000Z | 2021-11-15T12:26:32.000Z | 52-54-feedparser/my-code-RSS-feeds/pull_xml.py | Anthlis/My_100_Days_Of_Python | 9bdc36075f633099bd70161ae19ffad7ab88a797 | [
"MIT"
] | 1 | 2021-06-01T23:51:28.000Z | 2021-06-01T23:51:28.000Z | 52-54-feedparser/my-code-RSS-feeds/pull_xml.py | Anthlis/My_100_Days_Of_Python | 9bdc36075f633099bd70161ae19ffad7ab88a797 | [
"MIT"
] | 1 | 2021-01-06T14:36:27.000Z | 2021-01-06T14:36:27.000Z | #!python3
#pull_xml.py uses the requests module to pull down the feed xml file for use in the xml parser script.
#This will result in just one call/request to the Steam webserver hosting this XML file.
import requests
# TODO Create a namedtuple ('URL_chooser', 'index URL XML_file')
URL = "https://www.stuff.co.nz/rss... | 37.62 | 102 | 0.705476 |
import requests
URL = "https://www.stuff.co.nz/rss/"
URL1 = 'https://www.rnz.co.nz/rss/pacific.xml'
URL2 = 'http://rss.nzherald.co.nz/rss/xml/nzhrsscid_000000005.xml'
URL3 = 'https://www.rbnz.govt.nz/feeds/news'
URL4 = 'https://realpython.com/atom.xml'
URL5 = 'https://pybit.es/feeds/all.rss.xml'
URL6 = 'http://... | true | true |
f74ca81fe2fd4358d8aad3f9f6debcc73af2d880 | 1,911 | py | Python | test/functional/rpc_signmessage.py | CounosH/cch | 880f3890127951cba9f6b235193d8c9a9536e075 | [
"MIT"
] | null | null | null | test/functional/rpc_signmessage.py | CounosH/cch | 880f3890127951cba9f6b235193d8c9a9536e075 | [
"MIT"
] | null | null | null | test/functional/rpc_signmessage.py | CounosH/cch | 880f3890127951cba9f6b235193d8c9a9536e075 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The CounosH Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying messages."""
from test_framework.test_framework import Cou... | 44.44186 | 119 | 0.734171 |
from test_framework.test_framework import CounosHTestFramework
from test_framework.util import assert_equal
class SignMessagesTest(CounosHTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-addresstype=legacy"]]
def ski... | true | true |
f74ca8595afb100a739b2d5428b926c000ca570d | 8,634 | py | Python | mnist-collection/dcgan.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | mnist-collection/dcgan.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | null | null | null | mnist-collection/dcgan.py | shikisawamura/nnabla-examples | baf4e4cc620dedbf4368683325c0fb868676850d | [
"Apache-2.0"
] | 1 | 2020-04-25T06:11:28.000Z | 2020-04-25T06:11:28.000Z | # Copyright (c) 2017 Sony Corporation. 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 applicabl... | 37.53913 | 96 | 0.619759 |
from __future__ import absolute_import
from six.moves import range
import numpy as np
import nnabla as nn
import nnabla.logger as logger
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.solvers as S
import nnabla.utils.save as save
from args import get_args
from mnist... | true | true |
f74ca8c8a89107434e2c817ef0db28591bdb572c | 14,608 | py | Python | lib/graphy/graphy/common.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/graphy/graphy/common.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/graphy/graphy/common.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/python2.4
#
# Copyright 2008 Google 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 o... | 35.37046 | 80 | 0.661076 |
import copy
import warnings
from graphy import formatters
from graphy import util
class Marker(object):
arrow = 'a'
cross = 'c'
diamond = 'd'
circle = 'o'
square = 's'
x = 'x'
def __init__(self, shape, color, size):
self.shape = shape
self.color = c... | true | true |
f74cab154d9a09a50918d0af2a9ef62841faa0c8 | 1,897 | py | Python | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | scripts/dataToParquet.py | AeRabelais/bdt_pipeline | 35d0cc3f7ada35e082c384d0755916605daa5feb | [
"MIT"
] | null | null | null | """
@Title: dataToParquet.py
@author: Ashia Lewis
GOAL: Create and update the parquet files for the air and soil data, separately.
"""
import os
import glob
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
#CODE TO BE USED FOR THE BATCH DATA
"""
#file directories for the air and soi... | 27.1 | 81 | 0.727992 | import os
import glob
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
air_dir = r"D:\sample_biodiversitree\data\export_data\air_data"
soil_dir = r"D:\sample_biodiversitree\data\export_data\soil_data"
all_air_files = glob.glob(air_dir + '/**/*.csv', recursive=True)
all_soil_file... | true | true |
f74cab3a89fe0b0ef2a65bd8ce69c0c1e55f43a8 | 6,985 | py | Python | src/map/leetcode_map_solution.py | nutshellfool/algorithmPlayground_python | cb3a56a879ad5edc526a09c750c073596bb956d4 | [
"MIT"
] | null | null | null | src/map/leetcode_map_solution.py | nutshellfool/algorithmPlayground_python | cb3a56a879ad5edc526a09c750c073596bb956d4 | [
"MIT"
] | null | null | null | src/map/leetcode_map_solution.py | nutshellfool/algorithmPlayground_python | cb3a56a879ad5edc526a09c750c073596bb956d4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Solution(object):
def isAnagram(self, s, t):
if not s and not t:
return True
if (not s and t) or (s and not t):
return False
map_s = {}
for i, char in enumerate(s):
map_s[char] = map_s.get(char, 0) + 1
map_t ... | 29.597458 | 87 | 0.423908 |
class Solution(object):
def isAnagram(self, s, t):
if not s and not t:
return True
if (not s and t) or (s and not t):
return False
map_s = {}
for i, char in enumerate(s):
map_s[char] = map_s.get(char, 0) + 1
map_t = {}
for i, cha... | true | true |
f74cab9ed04da0f5adf4e6e41411afc8beceabaf | 55,330 | py | Python | pandas/tests/plotting/test_datetimelike.py | arushi-08/pandas | 014ea2e5a8a647cfa5e3050a5c1299eb39b293d3 | [
"BSD-3-Clause"
] | 2 | 2021-12-28T09:06:32.000Z | 2022-01-28T06:47:12.000Z | pandas/tests/plotting/test_datetimelike.py | arushi-08/pandas | 014ea2e5a8a647cfa5e3050a5c1299eb39b293d3 | [
"BSD-3-Clause"
] | 354 | 2018-05-26T13:28:49.000Z | 2022-03-31T01:11:46.000Z | pandas/tests/plotting/test_datetimelike.py | arushi-08/pandas | 014ea2e5a8a647cfa5e3050a5c1299eb39b293d3 | [
"BSD-3-Clause"
] | 2 | 2021-03-16T23:52:37.000Z | 2022-03-09T14:56:27.000Z | """ Test cases for time series specific (freq conversion, etc) """
from datetime import (
date,
datetime,
time,
timedelta,
)
import pickle
import numpy as np
import pytest
from pandas._libs.tslibs import (
BaseOffset,
to_offset,
)
import pandas.util._test_decorators as td
from pandas import (... | 36.092629 | 88 | 0.556985 | from datetime import (
date,
datetime,
time,
timedelta,
)
import pickle
import numpy as np
import pytest
from pandas._libs.tslibs import (
BaseOffset,
to_offset,
)
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
Index,
NaT,
Series,
isna,
to_da... | true | true |
f74cac8b5ffce5f3982ce1e39a5108a4d841c8cf | 1,052 | py | Python | tensorflow/python/distribute/experimental/__init__.py | jackode/tensorflow | 11f4ecb54708865ec757ca64e4805957b05d7570 | [
"Apache-2.0"
] | 1 | 2019-08-22T02:47:35.000Z | 2019-08-22T02:47:35.000Z | tensorflow/python/distribute/experimental/__init__.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/experimental/__init__.py | shekharpalit/tensorflow | 6aa83398ab03bfae822f36772757097bcb98b6ed | [
"Apache-2.0"
] | 1 | 2020-06-09T09:46:24.000Z | 2020-06-09T09:46:24.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.08 | 80 | 0.739544 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import collective_all_reduce_strategy
from tensorflow.python.distribute import parameter_server_strategy
| true | true |
f74cacc7fe45b8805860a6e6dd278d021d8b89bd | 3,753 | py | Python | sr/robot/arenas/two_colours_arena.py | maciekbogdalski/Assignment-for-RT-2021-22 | cdddffff203640aadf5f7b6826e542349d90b460 | [
"MIT"
] | null | null | null | sr/robot/arenas/two_colours_arena.py | maciekbogdalski/Assignment-for-RT-2021-22 | cdddffff203640aadf5f7b6826e542349d90b460 | [
"MIT"
] | null | null | null | sr/robot/arenas/two_colours_arena.py | maciekbogdalski/Assignment-for-RT-2021-22 | cdddffff203640aadf5f7b6826e542349d90b460 | [
"MIT"
] | 1 | 2021-11-10T15:23:43.000Z | 2021-11-10T15:23:43.000Z | from __future__ import division
from math import cos, pi, sin
import pygame
from pygame.rect import Rect
from arena import ARENA_MARKINGS_COLOR, ARENA_MARKINGS_WIDTH, Arena
from ..markers import Token
from ..vision import MARKER_TOKEN_GOLD, MARKER_TOKEN_SILVER
HOME_ZONE_SIZE = 2.5
INNER_CIRCLE_RADIUS = 0.42
OUTER_... | 37.158416 | 89 | 0.598987 | from __future__ import division
from math import cos, pi, sin
import pygame
from pygame.rect import Rect
from arena import ARENA_MARKINGS_COLOR, ARENA_MARKINGS_WIDTH, Arena
from ..markers import Token
from ..vision import MARKER_TOKEN_GOLD, MARKER_TOKEN_SILVER
HOME_ZONE_SIZE = 2.5
INNER_CIRCLE_RADIUS = 0.42
OUTER_... | true | true |
f74cada65596ad0506c574a18c1f35a7ff78d979 | 5,582 | py | Python | src/communities/migrations/0003_auto__chg_field_community_uid__add_unique_community_uid.py | ofirr/OpenCommunity | 7786ac2996530af8f545f4398c071793c73634c8 | [
"BSD-3-Clause"
] | 1 | 2015-05-12T17:59:35.000Z | 2015-05-12T17:59:35.000Z | src/communities/migrations/0003_auto__chg_field_community_uid__add_unique_community_uid.py | Niros/OpenCommunity | 4c91136db6243a1cd65b55ecf5a44c2bce24a45a | [
"BSD-3-Clause"
] | null | null | null | src/communities/migrations/0003_auto__chg_field_community_uid__add_unique_community_uid.py | Niros/OpenCommunity | 4c91136db6243a1cd65b55ecf5a44c2bce24a45a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Community.uid'
db.alter_column(u'communities_community', 'uid', self.gf('django.db.models... | 69.775 | 197 | 0.591903 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column(u'communities_community', 'uid', self.gf('django.db.models.fields.CharField')(unique=True, max_length=24))
... | true | true |
f74cae4715b2de9b80b63dd86bb803504fbd8065 | 307 | py | Python | File for Lab 9/lab9ex6.py | lifeplay2019/ECOR1051-project | fbd0ed3651adc2cfc4dca06d155a03fb9fcfb3f3 | [
"MIT"
] | null | null | null | File for Lab 9/lab9ex6.py | lifeplay2019/ECOR1051-project | fbd0ed3651adc2cfc4dca06d155a03fb9fcfb3f3 | [
"MIT"
] | null | null | null | File for Lab 9/lab9ex6.py | lifeplay2019/ECOR1051-project | fbd0ed3651adc2cfc4dca06d155a03fb9fcfb3f3 | [
"MIT"
] | null | null | null |
def rotate_left3(numbers:list)->list:
"""Returns a new list containing the same
elements, but they are "rotated left".
>>>rotate_left3(1,2,3)
[2,3,1]
>>>rotate_left3(2,3,4)
[3,4,2]
"""
lst[0] = b ,lst[1] = c, lst[2] = a
return [b,c,a]
| 19.1875 | 46 | 0.491857 |
def rotate_left3(numbers:list)->list:
lst[0] = b ,lst[1] = c, lst[2] = a
return [b,c,a]
| true | true |
f74caf5aac2fd8835fcff458df6a7ee081f87b57 | 6,794 | py | Python | pysnmp/CISCO-WAN-ATM-CONN-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-WAN-ATM-CONN-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-WAN-ATM-CONN-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-WAN-ATM-CONN-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-ATM-CONN-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 18:03:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | 97.057143 | 766 | 0.768031 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuild... | true | true |
f74caf8956304ba012dd3ae2dd9688cc0623f575 | 250 | py | Python | tests/test_base/test_objectpropertyaxioms.py | clin113jhu/funowl | 805963c9d2718598c85a1213106161b59f5a8dd3 | [
"CC0-1.0"
] | null | null | null | tests/test_base/test_objectpropertyaxioms.py | clin113jhu/funowl | 805963c9d2718598c85a1213106161b59f5a8dd3 | [
"CC0-1.0"
] | null | null | null | tests/test_base/test_objectpropertyaxioms.py | clin113jhu/funowl | 805963c9d2718598c85a1213106161b59f5a8dd3 | [
"CC0-1.0"
] | null | null | null | import unittest
from tests.utils.base import TestBase
class ObjectPropertyAxiomsTestCase(TestBase):
@unittest.expectedFailure
def test_something(self):
self.assertEqual(True, False)
if __name__ == '__main__':
unittest.main()
| 17.857143 | 45 | 0.74 | import unittest
from tests.utils.base import TestBase
class ObjectPropertyAxiomsTestCase(TestBase):
@unittest.expectedFailure
def test_something(self):
self.assertEqual(True, False)
if __name__ == '__main__':
unittest.main()
| true | true |
f74caf9231ca7074b73eeba74612e26294942102 | 8,704 | py | Python | plateau/io/iter.py | data-engineering-collective/plateau | ab87282a2f66c4f847654f28f8a2b0df33cb4d62 | [
"MIT"
] | 2 | 2022-02-11T01:27:56.000Z | 2022-03-18T22:44:02.000Z | plateau/io/iter.py | data-engineering-collective/plateau | ab87282a2f66c4f847654f28f8a2b0df33cb4d62 | [
"MIT"
] | 17 | 2022-02-08T16:14:19.000Z | 2022-03-31T00:36:16.000Z | plateau/io/iter.py | data-engineering-collective/plateau | ab87282a2f66c4f847654f28f8a2b0df33cb4d62 | [
"MIT"
] | 2 | 2022-02-08T16:59:00.000Z | 2022-02-08T17:54:39.000Z | from functools import partial
from typing import cast
from plateau.core.docs import default_docs
from plateau.core.factory import _ensure_factory
from plateau.core.naming import (
DEFAULT_METADATA_STORAGE_FORMAT,
DEFAULT_METADATA_VERSION,
SINGLE_TABLE,
)
from plateau.core.uuid import gen_uuid
from plateau.... | 27.2 | 100 | 0.666245 | from functools import partial
from typing import cast
from plateau.core.docs import default_docs
from plateau.core.factory import _ensure_factory
from plateau.core.naming import (
DEFAULT_METADATA_STORAGE_FORMAT,
DEFAULT_METADATA_VERSION,
SINGLE_TABLE,
)
from plateau.core.uuid import gen_uuid
from plateau.... | true | true |
f74cafed9287fdcf1645685507072621f7cfcc55 | 735 | py | Python | jupyter_helpers/table.py | krassowski/jupyter-helpers | 9feb0af6563b56d02688c18e1a9a415d15d9b1a2 | [
"MIT"
] | 45 | 2019-03-18T11:13:01.000Z | 2021-03-21T18:59:06.000Z | jupyter_helpers/table.py | krassowski/jupyter-helpers | 9feb0af6563b56d02688c18e1a9a415d15d9b1a2 | [
"MIT"
] | 6 | 2019-04-04T08:12:06.000Z | 2021-01-29T06:37:24.000Z | jupyter_helpers/table.py | krassowski/jupyter-helpers | 9feb0af6563b56d02688c18e1a9a415d15d9b1a2 | [
"MIT"
] | 5 | 2019-03-19T07:15:14.000Z | 2019-12-18T19:25:48.000Z | import pandas as pd
from IPython.core.display import display
def bordered_table(hide_headers=[], color='#ddd'):
return [
{'selector': 'th', 'props': [('text-align', 'center'), ('border', f'1px solid {color}')]},
{'selector': 'td', 'props': [('border', f'1px solid {color}')]},
*[
... | 29.4 | 98 | 0.572789 | import pandas as pd
from IPython.core.display import display
def bordered_table(hide_headers=[], color='#ddd'):
return [
{'selector': 'th', 'props': [('text-align', 'center'), ('border', f'1px solid {color}')]},
{'selector': 'td', 'props': [('border', f'1px solid {color}')]},
*[
... | true | true |
f74cb0c6c8d6498edda283fe610b72a57db22467 | 1,867 | py | Python | tests/base_service_config_test.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 34 | 2019-10-27T22:33:13.000Z | 2022-03-20T17:06:08.000Z | tests/base_service_config_test.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 4 | 2019-11-12T21:02:40.000Z | 2021-07-29T07:38:54.000Z | tests/base_service_config_test.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 5 | 2019-11-12T21:40:41.000Z | 2022-01-19T10:06:41.000Z | from pathlib import Path
import pytest
from pydantic import ValidationError
from fastapi_serviceutils.app import collect_config_definition
from fastapi_serviceutils.app import Config
@pytest.mark.parametrize(
'config_path',
[
'tests/configs/config.yml',
'tests/configs/config2.yml',
'... | 35.226415 | 63 | 0.733262 | from pathlib import Path
import pytest
from pydantic import ValidationError
from fastapi_serviceutils.app import collect_config_definition
from fastapi_serviceutils.app import Config
@pytest.mark.parametrize(
'config_path',
[
'tests/configs/config.yml',
'tests/configs/config2.yml',
'... | true | true |
f74cb1c5a431cde20462aba960e6079f900a9b3c | 3,273 | py | Python | tempest/api/identity/admin/v3/test_policies.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | 1 | 2021-05-21T08:24:02.000Z | 2021-05-21T08:24:02.000Z | tempest/api/identity/admin/v3/test_policies.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_policies.py | azorge/tempest | 549dfc93fb7e3d6d8566064a60a6069deae5c8eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 43.065789 | 79 | 0.665139 |
from tempest.api.identity import base
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest import test
class PoliciesTestJSON(base.BaseIdentityV3AdminTest):
def _delete_policy(self, policy_id):
self.policies_client.delete_policy(policy_id)
@d... | true | true |
f74cb27315ec4f9e9609e8e28119aba15175b3ce | 7,007 | py | Python | src/tiler.py | chelffey/tilebot | 3fa4cc3ea7c03786fb8ac02458ef4e6d464603ec | [
"MIT"
] | null | null | null | src/tiler.py | chelffey/tilebot | 3fa4cc3ea7c03786fb8ac02458ef4e6d464603ec | [
"MIT"
] | null | null | null | src/tiler.py | chelffey/tilebot | 3fa4cc3ea7c03786fb8ac02458ef4e6d464603ec | [
"MIT"
] | null | null | null | # Purpose: takes a list of filenames AND/OR publically accessible urls.
# Returns a tiled image file of tiles SIZExSIZE, separated by spaces of width
# DIFF, in rows if length ROWSIZE.
# files that can't be retrieved are returned blank.
import os
import numpy as np
from PIL import Image
import urllib.request
impor... | 36.878947 | 221 | 0.636792 |
import os
import numpy as np
from PIL import Image
import urllib.request
import validators
# global vars
EMPTY = "empty"
def crop_square(im):
# crops to square, based on smallest length.
width, height = im.size
side_length = min(width, height)
width_pad = (width - side_length) // 2
height_pad... | true | true |
f74cb31e77c79ff6e1fa2ec6876b96e89421d319 | 468 | py | Python | nlargestelement.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 37 | 2020-10-01T15:20:12.000Z | 2021-10-04T14:17:06.000Z | nlargestelement.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 27 | 2020-10-01T12:32:41.000Z | 2021-10-04T11:05:34.000Z | nlargestelement.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 57 | 2020-10-01T11:24:26.000Z | 2022-02-16T05:09:50.000Z | # Python program to find N largest
# element from given list of integers
# Function returns N largest elements
def Nmaxelements(list1, N):
final_list = []
for i in range(0, N):
max1 = 0
for j in range(len(list1)):
if list1[j] > max1:
max1 = list1[j];
list1.remove(max1);
final_list.... | 18 | 39 | 0.626068 |
def Nmaxelements(list1, N):
final_list = []
for i in range(0, N):
max1 = 0
for j in range(len(list1)):
if list1[j] > max1:
max1 = list1[j];
list1.remove(max1);
final_list.append(max1)
print(final_list)
list1 = [2, 6, 41, 85, 0, 3, 7, 6, 10]
N = 2
Nmaxelements(list1, N)
| true | true |
f74cb3fd71445df9b1cedee1722247e240d618e9 | 1,187 | py | Python | dsblocks/config/bt_defaults.py | Jaume-JCI/block-types | 868eb97afa41cd4fee1ec2e0a2a97489e21783e8 | [
"MIT"
] | null | null | null | dsblocks/config/bt_defaults.py | Jaume-JCI/block-types | 868eb97afa41cd4fee1ec2e0a2a97489e21783e8 | [
"MIT"
] | 37 | 2021-11-17T22:38:36.000Z | 2022-03-05T15:21:54.000Z | dsblocks/config/bt_defaults.py | Jaume-JCI/block-types | 868eb97afa41cd4fee1ec2e0a2a97489e21783e8 | [
"MIT"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/config/config.bt_defaults.ipynb (unless otherwise specified).
__all__ = ['path_results', 'path_models', 'path_data', 'file_format', 'verbose', 'name_logger', 'save_splits', 'group',
'error_if_present', 'overwrite_field', 'mode_logger', 'separate_labels', 'warn... | 29.675 | 119 | 0.728728 |
__all__ = ['path_results', 'path_models', 'path_data', 'file_format', 'verbose', 'name_logger', 'save_splits', 'group',
'error_if_present', 'overwrite_field', 'mode_logger', 'separate_labels', 'warning_if_nick_name_exists',
'propagate', 'path_session_folder', 'session_filename', 'path_logger_fol... | true | true |
f74cb46399755f112422bd71ab055ccf9b61ea3f | 6,423 | py | Python | model_measuring/kamal/core/engine/engine.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-01-11T07:14:37.000Z | 2022-01-11T07:14:37.000Z | model_measuring/kamal/core/engine/engine.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-04T07:19:43.000Z | 2022-03-04T07:19:43.000Z | model_measuring/kamal/core/engine/engine.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-20T13:09:14.000Z | 2022-03-20T13:09:14.000Z | """
Copyright 2020 Tianshu AI Platform. 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 ... | 33.805263 | 92 | 0.630391 |
import torch
import torch.nn as nn
import abc, math, weakref, typing, time
from typing import Any, Callable, Optional, Sequence
import numpy as np
from kamal.core.engine.events import DefaultEvents, Event
from kamal.core import tasks
from kamal.utils import set_mode, move_to_device, get_logger
from collections impor... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.