hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
113612662c894fd4be1108c6029f6f4ad2567edd | 180 | py | Python | WBS_Management_Tool/wsgi.py | surajsjain/interractive-wbs-management-tool | 10e039feb750bc8567d34e6186778102f650124a | [
"MIT"
] | 1 | 2020-02-26T05:52:33.000Z | 2020-02-26T05:52:33.000Z | WBS_Management_Tool/wsgi.py | surajsjain/interractive-wbs-management-tool | 10e039feb750bc8567d34e6186778102f650124a | [
"MIT"
] | 7 | 2020-06-06T00:10:32.000Z | 2021-06-10T19:12:36.000Z | WBS_Management_Tool/wsgi.py | surajsjain/interractive-wbs-management-tool | 10e039feb750bc8567d34e6186778102f650124a | [
"MIT"
] | 1 | 2021-03-21T08:44:48.000Z | 2021-03-21T08:44:48.000Z | import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'WBS_Management_Tool.settings')
application = get_wsgi_application()
| 22.5 | 79 | 0.838889 |
29b90490d85791a1b08af320797c516c094388c2 | 5,930 | py | Python | Drebin/data_utils.py | starlettkim/deepxplore | e9e2e1e9e7bfda898971aad09b5c40d72f137278 | [
"MIT"
] | 6 | 2019-04-09T14:07:28.000Z | 2020-09-27T20:24:42.000Z | Drebin/data_utils.py | HanPhoenix/deepxplore | 8795b89a458cbfde733820798802eed549ce66db | [
"MIT"
] | null | null | null | Drebin/data_utils.py | HanPhoenix/deepxplore | 8795b89a458cbfde733820798802eed549ce66db | [
"MIT"
] | 1 | 2019-06-04T09:36:59.000Z | 2019-06-04T09:36:59.000Z | from utils import preprocess_app
import numpy as np
import os
import random
from configs import bcolors
def training_data_generator(training_apps, feats, malwares, path, batch_size=64):
# training_apps = np.random.choice(train_test_apps, int(len(train_test_apps) * 0.66)) # 66% for training
gen_state = 0
... | 38.75817 | 118 | 0.566948 |
7367bb10ef76a13ff23a51e50d0ac9199a86e8b8 | 3,444 | py | Python | buildscripts/resmokelib/testing/fixtures/interface.py | stbrody/mongo | e6df4d48792498545a9069f08ff78f7840700ef6 | [
"Apache-2.0"
] | 1 | 2020-03-23T02:59:49.000Z | 2020-03-23T02:59:49.000Z | buildscripts/resmokelib/testing/fixtures/interface.py | stbrody/mongo | e6df4d48792498545a9069f08ff78f7840700ef6 | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/testing/fixtures/interface.py | stbrody/mongo | e6df4d48792498545a9069f08ff78f7840700ef6 | [
"Apache-2.0"
] | null | null | null | """
Interface of the different fixtures for executing JSTests against.
"""
from __future__ import absolute_import
import time
import pymongo
from ... import errors
from ... import logging
class Fixture(object):
"""
Base class for all fixtures.
"""
def __init__(self, logger, job_num):
"""
... | 28.46281 | 98 | 0.607143 |
9a50c4bb55688d1250809059b1e11975ec6c3731 | 230 | py | Python | tests/test_app.py | sd19surf/flask | 3369b3bd74ea7e0489f3c3ba14482aaf89d33a88 | [
"MIT"
] | null | null | null | tests/test_app.py | sd19surf/flask | 3369b3bd74ea7e0489f3c3ba14482aaf89d33a88 | [
"MIT"
] | null | null | null | tests/test_app.py | sd19surf/flask | 3369b3bd74ea7e0489f3c3ba14482aaf89d33a88 | [
"MIT"
] | null | null | null | from app import create_app
def test_index(client):
response = client.get("/")
assert response.data == b"Index Page"
def test_hello(client):
response = client.get("/hello")
assert response.data == b"Hello World!"
| 23 | 43 | 0.682609 |
556569c8ef61c089f8cb74b1f3616a2f268d8577 | 4,392 | py | Python | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/ipsec_policy.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/ipsec_policy.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/ipsec_policy.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.8 | 80 | 0.653233 |
3bad3de780b70e9157abcd0f85eb1d2f78deafdd | 1,487 | py | Python | tests/test_angles.py | chloeoframe/analysis | aef1a90de2cddcb945b01791a758282011eb3280 | [
"MIT"
] | null | null | null | tests/test_angles.py | chloeoframe/analysis | aef1a90de2cddcb945b01791a758282011eb3280 | [
"MIT"
] | 42 | 2019-10-12T23:26:18.000Z | 2021-03-04T20:12:43.000Z | tests/test_angles.py | chloeoframe/analysis | aef1a90de2cddcb945b01791a758282011eb3280 | [
"MIT"
] | 4 | 2020-01-08T19:16:01.000Z | 2020-04-08T19:47:45.000Z | import pytest
import numpy as np
import analysis
from .conf_test import ConfTest
class TestAngles(ConfTest):
@pytest.fixture
def sample_coords(self):
coord1 = [[1, 0, 0], [0, -1, 0], [1, 1, 1], [-1, 2, 4]]
coord2 = [[0, 1, 0], [0, 1, 0], [1, 2, 1], [2, 3, -1]]
coord1 = np.array(coord1,... | 33.795455 | 88 | 0.559516 |
c35584f5085b2ae1bbfbb699e174887a2d41c261 | 1,272 | py | Python | web_flask/5-number_template.py | billhong6981/BH_Todos | 3fdeacf3dcc6ee88f3975aedd1646dba1040f0d9 | [
"MIT"
] | 1 | 2019-12-26T21:06:54.000Z | 2019-12-26T21:06:54.000Z | web_flask/5-number_template.py | billhong6981/BH_Todos | 3fdeacf3dcc6ee88f3975aedd1646dba1040f0d9 | [
"MIT"
] | null | null | null | web_flask/5-number_template.py | billhong6981/BH_Todos | 3fdeacf3dcc6ee88f3975aedd1646dba1040f0d9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Sript that starts a Flask web application
"""
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/', strict_slashes=False)
def hello_bh():
"""
function to return Hello BH!
"""
return "Hello BH!"
@app.route('/bh', strict_slashes=False)
def bh():
"""
... | 22.315789 | 65 | 0.602201 |
58f74af62f467471764ff6cddd573d1207fc231b | 1,185 | py | Python | var/spack/repos/builtin/packages/librsb/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/librsb/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/librsb/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Librsb(AutotoolsPackage):
"""librsb : A shared memory parallel sparse matrix computations
... | 34.852941 | 92 | 0.666667 |
e36924f1c30e1e1c03e75e61d7e48c60f5f42973 | 561 | py | Python | oops_fhir/r4/value_set/all_languages.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/all_languages.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/all_languages.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["AllLanguages"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class AllLanguages(ValueSet):
"""
All Languages
This value set includes all possibl... | 18.7 | 69 | 0.7041 |
c4cd895d861ccd7492a6756986ad2a8720f8a0f8 | 966 | py | Python | python/phonenumbers/shortdata/region_KW.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/shortdata/region_KW.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/shortdata/region_KW.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. KW metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KW = PhoneMetadata(id='KW', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_number_pattern='\\d{... | 74.307692 | 122 | 0.792961 |
49f81f56f4e035176734b0097a4c90b7cf2cff95 | 6,663 | py | Python | nlpsandbox/model/page_of_annotations_all_of.py | Sage-Bionetworks/nlp-sandbox-client | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2021-06-15T16:36:10.000Z | 2021-11-15T01:44:46.000Z | nlpsandbox/model/page_of_annotations_all_of.py | nlpsandbox/nlpsandbox-client | 8cba4f65ff2c06cbef7dc50f45b0aec9b8ee0476 | [
"Apache-2.0"
] | 165 | 2020-11-23T00:36:40.000Z | 2022-03-24T00:53:59.000Z | nlpsandbox/model/page_of_annotations_all_of.py | data2health/nlp-sandbox-evaluation | e51720b35ca3413ccee71b9cdc223ce3578fe0fd | [
"Apache-2.0"
] | 3 | 2020-12-11T00:04:13.000Z | 2022-01-03T16:59:10.000Z | """
NLP Sandbox API
NLP Sandbox REST API # noqa: E501
The version of the OpenAPI document: 1.2.0
Contact: team@nlpsandbox.io
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from nlpsandbox.model_utils import ( # noqa: F401
ApiTypeError,
... | 38.514451 | 110 | 0.586973 |
ede841b9d7873f91cb6bf1339c5f988b22a8a4c8 | 402 | py | Python | blender/arm/logicnode/physics_get_gravity.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | 1 | 2018-12-04T05:33:53.000Z | 2018-12-04T05:33:53.000Z | blender/arm/logicnode/physics_get_gravity.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | null | null | null | blender/arm/logicnode/physics_get_gravity.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | null | null | null | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class GetGravityNode(Node, ArmLogicTreeNode):
'''Get Gravity node'''
bl_idname = 'LNGetGravityNode'
bl_label = 'Get Gravity'
bl_icon = 'GAME'
def init(self, context):
self.inputs... | 25.125 | 54 | 0.716418 |
e1aadac7d0a09efdbb0055db1efe22d1f15ad36d | 12,100 | py | Python | pypykatz/registry/sam/structures.py | alxchk/pypykatz | 151f11bb2a06adf4358e80cdf287bb8d093edcc0 | [
"MIT"
] | 5 | 2019-04-20T05:34:01.000Z | 2019-10-12T01:26:09.000Z | pypykatz/registry/sam/structures.py | alxchk/pypykatz | 151f11bb2a06adf4358e80cdf287bb8d093edcc0 | [
"MIT"
] | 1 | 2018-09-13T15:20:29.000Z | 2018-09-13T15:20:29.000Z | pypykatz/registry/sam/structures.py | alxchk/pypykatz | 151f11bb2a06adf4358e80cdf287bb8d093edcc0 | [
"MIT"
] | 8 | 2018-09-11T22:02:22.000Z | 2019-11-27T08:52:20.000Z | #!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
import io
import struct
class DOMAIN_ACCOUNT_F:
def __init__(self):
self.revision = None
self.unk1 = None
self.creation_time = None
self.domain_modified_count = None
self.max_pw_age = None
self.min_pw_age = None
self.force_logoff = None
se... | 31.842105 | 80 | 0.672231 |
5b824765de23d254b61391e96e1772821ccde160 | 28,182 | py | Python | config/custom_components/hacs/base.py | Poeschl/home-assistant-config | 380640bc46b14542866fbf8bbdc4218b2d58b55c | [
"MIT"
] | null | null | null | config/custom_components/hacs/base.py | Poeschl/home-assistant-config | 380640bc46b14542866fbf8bbdc4218b2d58b55c | [
"MIT"
] | 16 | 2022-01-16T20:20:29.000Z | 2022-03-28T06:26:49.000Z | config/custom_components/hacs/base.py | Poeschl/home-assistant-config | 380640bc46b14542866fbf8bbdc4218b2d58b55c | [
"MIT"
] | null | null | null | """Base HACS class."""
from __future__ import annotations
import asyncio
from dataclasses import asdict, dataclass, field
from datetime import timedelta
import gzip
import json
import logging
import math
import os
import pathlib
import shutil
from typing import TYPE_CHECKING, Any, Awaitable, Callable
from aiogithubap... | 35.854962 | 109 | 0.618338 |
10a489026aec6fd52837d9d09a8f3f45ee71a0ff | 579 | py | Python | jd_login/login_by_selenium.py | awesome-archive/awesome-python-login-model | 98aecab631a717934efc308c873fd00cbc6ef930 | [
"MIT"
] | 2 | 2019-04-12T15:10:02.000Z | 2019-04-12T15:11:18.000Z | jd_login/login_by_selenium.py | masdude/awesome-python-login-model | aa67e633c0be8634081bae9fa1ed218c1f9fb75c | [
"MIT"
] | null | null | null | jd_login/login_by_selenium.py | masdude/awesome-python-login-model | aa67e633c0be8634081bae9fa1ed218c1f9fb75c | [
"MIT"
] | 1 | 2019-03-31T15:45:36.000Z | 2019-03-31T15:45:36.000Z | # tested on ubuntu15.04
import time
from selenium import webdriver
# 强东的系统登陆模块没有用iframe,定位也没有微博那么复杂,可以靠id定位登陆
login_url = 'https://passport.jd.com/new/login.aspx'
driver = webdriver.PhantomJS()
driver.get(login_url)
time.sleep(5)
account = driver.find_element_by_id('loginname')
password = driver.find_element_by_id('... | 22.269231 | 52 | 0.792746 |
2e467c96550c26314a8eea94f08741a884138210 | 7,465 | py | Python | desktop/libs/indexer/src/indexer/indexers/envelope.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | null | null | null | desktop/libs/indexer/src/indexer/indexers/envelope.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | null | null | null | desktop/libs/indexer/src/indexer/indexers/envelope.py | HSunboy/hue | caccd8c058eabb8f5899006a6566be46e3af871b | [
"Apache-2.0"
] | 1 | 2020-07-25T12:44:18.000Z | 2020-07-25T12:44:18.000Z | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | 30.469388 | 116 | 0.590221 |
f6420122df97507bd16a341843cd20b507887c64 | 621 | py | Python | myMongo.py | pratul1/WebScrapper | 07d964ec034220f9e890008f49f09c415894937f | [
"MIT"
] | null | null | null | myMongo.py | pratul1/WebScrapper | 07d964ec034220f9e890008f49f09c415894937f | [
"MIT"
] | null | null | null | myMongo.py | pratul1/WebScrapper | 07d964ec034220f9e890008f49f09c415894937f | [
"MIT"
] | null | null | null | from pymongo import MongoClient
client = MongoClient()
db = client.test
db.products.insert_one({"Product_id":"ASIN","Vendor_id":"Seller_Id","ProductName":"PName","ProductDescription":"PDesc","CategoryID":"Category","Sizes_Available":"","Colours_Available":"", "Vendor_Nmae":"Vname","Unit_Price":"Price",""});
d... | 51.75 | 237 | 0.700483 |
a0c2d6845665242f3b7ae913f6e0e23bd759c9c6 | 347 | py | Python | pygotham/sponsors/__init__.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 19 | 2015-03-03T19:50:55.000Z | 2019-11-19T17:55:33.000Z | pygotham/sponsors/__init__.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 124 | 2015-01-23T06:28:44.000Z | 2020-10-03T12:59:30.000Z | pygotham/sponsors/__init__.py | PyGotham/pygotham | 310508c16dabf2ce9aaf0c2624132d725f71143b | [
"BSD-3-Clause"
] | 21 | 2015-04-15T03:01:07.000Z | 2020-10-03T12:55:38.000Z | """Sponsors package."""
from flask import g
from pygotham.sponsors.models import Level, Sponsor
__all__ = ('get_accepted',)
def get_accepted():
"""Get the accepted sponsors."""
return Sponsor.query.join(Level).filter(
Sponsor.accepted == True, # NOQA
Level.event == g.current_event,
).o... | 21.6875 | 51 | 0.668588 |
701909950c5ae976f81fa4a5ae2005d32c692f6a | 5,066 | py | Python | mmgen/datasets/builder.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | mmgen/datasets/builder.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | mmgen/datasets/builder.py | liuhd073/mmgeneration | 2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import platform
import random
import warnings
from copy import deepcopy
from functools import partial
import numpy as np
import torch
from mmcv.parallel import collate
from mmcv.runner import get_dist_info
from mmcv.utils import TORCH_VERSION, Registry, build_from_cfg, d... | 34.69863 | 79 | 0.650415 |
9e8f1093c30fa2c6eb5c1529fd694ade46d58023 | 930 | py | Python | xuangu/models.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | null | null | null | xuangu/models.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | 3 | 2021-07-15T13:23:28.000Z | 2021-12-09T03:32:16.000Z | zixuan/models.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | 1 | 2021-08-19T14:42:59.000Z | 2021-08-19T14:42:59.000Z | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now
# Create your models here.
class BaseModel(models.Model):
id = models.AutoField(primary_key=True)
created_time = models.DateTimeField(_('创建时间'), default=now)
last_mod_time = models.D... | 30 | 73 | 0.689247 |
a8570ad823a02b0a9b5ad22b76e1665eddb72b58 | 12,458 | py | Python | core/controllers/learner_dashboard_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | 1 | 2017-11-30T02:16:01.000Z | 2017-11-30T02:16:01.000Z | core/controllers/learner_dashboard_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | null | null | null | core/controllers/learner_dashboard_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 40.057878 | 78 | 0.691283 |
0a432c1ce9d6b6a2698efcca0084a5b084ba020b | 394 | py | Python | set_stockCodes/set_hs300.py | VincentGaoHJ/Spyder-Guba | 35c888438168e78c71851293f943c85479fbb2ad | [
"MIT"
] | null | null | null | set_stockCodes/set_hs300.py | VincentGaoHJ/Spyder-Guba | 35c888438168e78c71851293f943c85479fbb2ad | [
"MIT"
] | null | null | null | set_stockCodes/set_hs300.py | VincentGaoHJ/Spyder-Guba | 35c888438168e78c71851293f943c85479fbb2ad | [
"MIT"
] | null | null | null | import re
from pymongo import *
# import pymongo
# this script is used to insert the HS300 stockcodes into MongoDB
client = MongoClient()
db = client['stockcodes']
f= open('HS300.txt','r')
all_text = f.read()
stockcodes = re.findall('\d{6}',all_text)
for stockcode in stockcodes:
result = db.HS300.insert_one({
... | 23.176471 | 65 | 0.69797 |
aacb663f8cc88ed07b9ce4e260629db7244e6cde | 1,569 | py | Python | ost_parser/analysis/__init__.py | autocorr/ost-parser | 06ef649aaa0e49c1effc04fa5c5042045a16f584 | [
"MIT"
] | null | null | null | ost_parser/analysis/__init__.py | autocorr/ost-parser | 06ef649aaa0e49c1effc04fa5c5042045a16f584 | [
"MIT"
] | null | null | null | ost_parser/analysis/__init__.py | autocorr/ost-parser | 06ef649aaa0e49c1effc04fa5c5042045a16f584 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Analyze OST observing script extracted data.
"""
import pandas as pd
from pandas import Index as idx
HF_RCVRS = ["22GHz", "33GHz", "45GHz"]
LF_RCVRS = ["75MHz", "300MHz", "1.5GHz", "3GHz", "6GHz", "10GHz", "15GHz"]
def summarize_continuum(df):
# number of WIDAR configs that are:
... | 27.526316 | 77 | 0.609943 |
712a906b56e3b6c55d3256131189ec22f4e4482e | 6,578 | py | Python | dojo/tools/snyk/parser.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,772 | 2018-01-22T23:32:15.000Z | 2022-03-31T14:49:33.000Z | dojo/tools/snyk/parser.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 3,461 | 2018-01-20T19:12:28.000Z | 2022-03-31T17:14:39.000Z | dojo/tools/snyk/parser.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,173 | 2018-01-23T07:10:23.000Z | 2022-03-31T14:40:43.000Z | import json
from cvss.cvss3 import CVSS3
from dojo.models import Finding
class SnykParser(object):
def get_scan_types(self):
return ["Snyk Scan"]
def get_label_for_scan_types(self, scan_type):
return scan_type # no custom label for now
def get_description_for_scan_types(self, scan_typ... | 38.694118 | 101 | 0.562937 |
d5f5eeeb0f845b0ab06911996d5a253cc11e1c59 | 806 | py | Python | 210222/step_4.py | kurganITteacher/python-adv | 3ebc048598eea00f12ebdb6a502b2455465a04c0 | [
"Apache-2.0"
] | 1 | 2021-09-02T10:21:35.000Z | 2021-09-02T10:21:35.000Z | 210222/step_4.py | kurganITteacher/python-adv | 3ebc048598eea00f12ebdb6a502b2455465a04c0 | [
"Apache-2.0"
] | null | null | null | 210222/step_4.py | kurganITteacher/python-adv | 3ebc048598eea00f12ebdb6a502b2455465a04c0 | [
"Apache-2.0"
] | 2 | 2021-03-14T07:44:18.000Z | 2021-04-25T18:18:02.000Z | import numpy as np
from PIL import Image
image_name = 'Desert.jpg'
image = Image.open(image_name)
# print(dir(image))
# print(image)
image_np = np.array(image)
print(image_np.size, image_np.shape)
# print(image_np) # uint8 -> 0..255
image_np_conv = image_np
image_np_conv[:, :, 2][image_np_conv[:, :, 2] <= 225] += 30
... | 31 | 69 | 0.658809 |
4a7893d3a79a48068d16faa465acf060eaaa6bac | 11,551 | py | Python | loaner/web_app/backend/clients/bigquery.py | isabella232/loaner | 24f9a9e70434e430f1beb4ead87e3675f4b53676 | [
"Apache-2.0"
] | 175 | 2018-03-28T20:33:39.000Z | 2022-03-27T06:02:39.000Z | loaner/web_app/backend/clients/bigquery.py | isabella232/loaner | 24f9a9e70434e430f1beb4ead87e3675f4b53676 | [
"Apache-2.0"
] | 111 | 2018-05-22T18:50:59.000Z | 2022-01-23T23:11:15.000Z | loaner/web_app/backend/clients/bigquery.py | isabella232/loaner | 24f9a9e70434e430f1beb4ead87e3675f4b53676 | [
"Apache-2.0"
] | 70 | 2018-03-30T01:52:06.000Z | 2021-10-13T11:20:10.000Z | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.109422 | 105 | 0.690936 |
5900e6e7b122828ee2f3690fab6412d582fad745 | 10,008 | py | Python | timeline/forms.py | lukmarcus/hiveprojects.io | 3595c0099893fefbfaa07bddc472abd111666178 | [
"MIT"
] | 20 | 2017-09-05T17:19:19.000Z | 2018-06-26T01:46:21.000Z | timeline/forms.py | lukmarcus/hiveprojects.io | 3595c0099893fefbfaa07bddc472abd111666178 | [
"MIT"
] | 117 | 2017-08-18T13:24:44.000Z | 2018-08-17T18:37:45.000Z | timeline/forms.py | djonie08/Github | 51ee7af6313d32aad4dde7ccb97e48cc347681c3 | [
"MIT"
] | 9 | 2017-10-01T18:15:11.000Z | 2018-04-24T15:15:36.000Z | import re
from markdown import markdown
from django.core.exceptions import ValidationError
from django import forms
from django.forms import formset_factory, BaseFormSet, HiddenInput, CharField, BooleanField
from django.forms.formsets import (
ManagementForm,
TOTAL_FORM_COUNT,
INITIAL_FORM_COUNT,
MIN_N... | 36.929889 | 118 | 0.638689 |
3597930834514f1a22c9b5dec3a2d87f5b075781 | 1,633 | py | Python | day3/makeasentece.py | tato69/myfirstrepo | d0ead5d9f4eb458b1fbd64d90e0db5cae212e85d | [
"Apache-2.0"
] | null | null | null | day3/makeasentece.py | tato69/myfirstrepo | d0ead5d9f4eb458b1fbd64d90e0db5cae212e85d | [
"Apache-2.0"
] | null | null | null | day3/makeasentece.py | tato69/myfirstrepo | d0ead5d9f4eb458b1fbd64d90e0db5cae212e85d | [
"Apache-2.0"
] | null | null | null | import random
s_nouns = ["A dude", "My mom", "The king", "Some guy", "A cat with rabies", "A sloth", "Your homie", "This cool guy my gardener met yesterday", "Superman"]
p_nouns = ["These dudes", "Both of my moms", "All the kings of the world", "Some guys", "All of a cattery's cats", "The multitude of sloths living un... | 65.32 | 229 | 0.685242 |
c7ee60b8cd3a14b6c1199ebac9a36d69b0f0df3b | 82 | py | Python | swagger_py_codegen/__main__.py | Weilor/swagger-py-codegen | a9628baf8cbf1f59dbc48cc4b703b11d7f30f9a4 | [
"MIT"
] | 591 | 2015-05-14T07:35:27.000Z | 2022-03-28T05:41:57.000Z | swagger_py_codegen/__main__.py | Weilor/swagger-py-codegen | a9628baf8cbf1f59dbc48cc4b703b11d7f30f9a4 | [
"MIT"
] | 86 | 2015-05-14T08:54:58.000Z | 2022-02-21T10:37:15.000Z | swagger_py_codegen/__main__.py | Weilor/swagger-py-codegen | a9628baf8cbf1f59dbc48cc4b703b11d7f30f9a4 | [
"MIT"
] | 177 | 2015-05-14T07:48:18.000Z | 2022-02-22T08:17:20.000Z | from __future__ import absolute_import
from .command import generate
generate()
| 13.666667 | 38 | 0.829268 |
6a60da134a8bbdfcaf05dcf68d7196e760da1402 | 268 | py | Python | Programas-Python/estruturas-condicionais.py | Gabriel-Leao/Estudos-Python | 1a78bc0418a87722a4cccddba3b7d667d303d82b | [
"MIT"
] | null | null | null | Programas-Python/estruturas-condicionais.py | Gabriel-Leao/Estudos-Python | 1a78bc0418a87722a4cccddba3b7d667d303d82b | [
"MIT"
] | null | null | null | Programas-Python/estruturas-condicionais.py | Gabriel-Leao/Estudos-Python | 1a78bc0418a87722a4cccddba3b7d667d303d82b | [
"MIT"
] | null | null | null | valor_onibus = 4.40
valor_uber = float(input('Digite o valor da corrida: '))
if valor_uber <= valor_onibus * 5:
print('Pegue a corrida')
elif valor_uber <= valor_onibus *6:
print('Espere um pouco, pois o valor pode abaixar')
else:
print('Pegue o ônibus')
| 26.8 | 56 | 0.69403 |
243e44ed7dbbd4b5e4c0aa881dc8ee78942c1598 | 34,857 | py | Python | dmon-agent/dmon-agent.py | igabriel85/DICE-Project | eb1c43fcef4bdd9ca7e75c51c0b58d0d1fdc1c29 | [
"Apache-2.0"
] | 1 | 2015-06-09T22:03:21.000Z | 2015-06-09T22:03:21.000Z | dmon-agent/dmon-agent.py | igabriel85/IeAT-DICE-Repository | eb1c43fcef4bdd9ca7e75c51c0b58d0d1fdc1c29 | [
"Apache-2.0"
] | 165 | 2015-08-13T23:00:33.000Z | 2017-03-09T20:25:23.000Z | dmon-agent/dmon-agent.py | igabriel85/DICE-Monitoring | eb1c43fcef4bdd9ca7e75c51c0b58d0d1fdc1c29 | [
"Apache-2.0"
] | 3 | 2016-03-03T14:20:13.000Z | 2016-11-09T19:57:42.000Z | """
Copyright 2015, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro
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:
ht... | 48.078621 | 156 | 0.565453 |
4f3a3e9e2c704ab25c32d75ae9c5847027e4f077 | 2,147 | py | Python | server/athenian/api/models/web/filter_releases_request.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 9 | 2020-10-11T22:12:03.000Z | 2022-02-26T02:16:45.000Z | server/athenian/api/models/web/filter_releases_request.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 246 | 2019-12-05T06:37:30.000Z | 2022-03-29T10:00:07.000Z | server/athenian/api/models/web/filter_releases_request.py | athenianco/athenian-api | dd5556101a8c49703d6b0516e4268b9e8d8eda5b | [
"RSA-MD"
] | 5 | 2019-12-04T22:38:05.000Z | 2021-02-26T00:50:04.000Z | from typing import List, Optional
from athenian.api.models.web.base_model_ import AllOf, Model
from athenian.api.models.web.common_filter_properties import CommonFilterProperties
from athenian.api.models.web.for_set import CommonPullRequestFilters
from athenian.api.models.web.release_with import ReleaseWith
class _F... | 27.525641 | 83 | 0.629716 |
46af2a7dde454c49ce5e4cefd784c709195cca1c | 34,991 | py | Python | client/tests/configuration_test.py | theodoretliu/pyre-check | b3dff2e32ec115e853f9171dc018d831e561439d | [
"MIT"
] | null | null | null | client/tests/configuration_test.py | theodoretliu/pyre-check | b3dff2e32ec115e853f9171dc018d831e561439d | [
"MIT"
] | null | null | null | client/tests/configuration_test.py | theodoretliu/pyre-check | b3dff2e32ec115e853f9171dc018d831e561439d | [
"MIT"
] | null | null | null | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
import os
import site
import sys
import unittest
from pathlib import Path
from typing import Any, NamedTuple, Optional, cast
from uni... | 39.183651 | 88 | 0.564774 |
985fc2c9df6826b8d8136109b7711d0671d32ca1 | 10,299 | py | Python | scripts/backprop_implementation.py | divyanshu-talwar/Training-NNs-without-Backpropagation | 7845b7086ecbc296ecc775a4c932034962ad54f5 | [
"MIT"
] | null | null | null | scripts/backprop_implementation.py | divyanshu-talwar/Training-NNs-without-Backpropagation | 7845b7086ecbc296ecc775a4c932034962ad54f5 | [
"MIT"
] | 4 | 2021-06-08T20:29:23.000Z | 2022-03-12T00:02:12.000Z | scripts/backprop_implementation.py | divyanshu-talwar/Training-NNs-without-Backpropagation | 7845b7086ecbc296ecc775a4c932034962ad54f5 | [
"MIT"
] | null | null | null | import sklearn.datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error, mean_squared_error
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import matplotlib.pyplot ... | 34.911864 | 159 | 0.718905 |
4e0a1cbf80b7c2bb8ef4cd5398c3e239742cfbc5 | 1,093 | py | Python | com/xy/ztang/strlearning/str_method_new.py | zhangptang/python_learning | d85987e9df465498cd9c5f99d9ee694d67fe8d11 | [
"MIT"
] | null | null | null | com/xy/ztang/strlearning/str_method_new.py | zhangptang/python_learning | d85987e9df465498cd9c5f99d9ee694d67fe8d11 | [
"MIT"
] | null | null | null | com/xy/ztang/strlearning/str_method_new.py | zhangptang/python_learning | d85987e9df465498cd9c5f99d9ee694d67fe8d11 | [
"MIT"
] | null | null | null | # -*-coding:utf-8-*-
"""
字符串中一些方法的调用实例
"""
if __name__ == '__main__':
str1 = 'adminpwd1234'
# 计算字符串的长度
print(len(str1))
# 字符串首字母大写
print(str1.capitalize())
# 字符串每个单词首字母大写
print(str1.title())
# 字符串字母大写
print(str1.upper())
# 从字符串中查找子串的位置
print(str1.find('12'))
print(str1... | 21.86 | 37 | 0.592864 |
82b782449c8bde8c8a6d39fb54c6bcf3cff884c8 | 2,729 | py | Python | datasets/transforms/ContrastiveCrop.py | xyupeng/ContrastiveCrop | 305ff6d06f7e81a5a9f7f80480d81adc11436f9b | [
"MIT"
] | 148 | 2022-02-07T18:11:26.000Z | 2022-03-31T09:04:32.000Z | datasets/transforms/ContrastiveCrop.py | xyupeng/ContrastiveCrop | 305ff6d06f7e81a5a9f7f80480d81adc11436f9b | [
"MIT"
] | 5 | 2022-03-09T11:53:55.000Z | 2022-03-31T12:33:08.000Z | datasets/transforms/ContrastiveCrop.py | xyupeng/ContrastiveCrop | 305ff6d06f7e81a5a9f7f80480d81adc11436f9b | [
"MIT"
] | 11 | 2022-02-12T00:10:04.000Z | 2022-03-30T11:34:59.000Z | from torchvision.transforms import RandomResizedCrop
import torch
import random
import numpy as np
import math
from torch.distributions.beta import Beta
import torchvision.transforms.functional as F
class ContrastiveCrop(RandomResizedCrop): # adaptive beta
def __init__(self, alpha=1.0, **kwargs):
super()... | 34.544304 | 83 | 0.534995 |
dad2bbdbfc908444e1262e115147e77d28259fd5 | 3,954 | py | Python | alipay/aop/api/request/AnttechOceanbaseNotifySendRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AnttechOceanbaseNotifySendRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AnttechOceanbaseNotifySendRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AnttechOceanbaseNotifySendModel import AnttechOceanbaseNotifySendModel
class AnttechOceanbaseNotifySendRequest(object):
def __i... | 27.268966 | 148 | 0.643399 |
101d0e4c7a6bff0752ac36af854b72b12bc5b872 | 40,626 | bzl | Python | tensorflow/workspace.bzl | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 1 | 2018-11-21T03:07:45.000Z | 2018-11-21T03:07:45.000Z | tensorflow/workspace.bzl | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | tensorflow/workspace.bzl | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | # TensorFlow external dependencies that can be loaded in WORKSPACE files.
load("//third_party/gpus:cuda_configure.bzl", "cuda_configure")
load("//third_party/gpus:rocm_configure.bzl", "rocm_configure")
load("//third_party/tensorrt:tensorrt_configure.bzl", "tensorrt_configure")
load("//third_party:nccl/nccl_configure.b... | 44.158696 | 177 | 0.671639 |
1d77904876dd52808231fc8604647531ce3909de | 7,607 | py | Python | train_SemanticKITTI.py | huixiancheng/RandLA-Net-pytorch | ccf016a3c4b8170bf07db9d732a7b86fed5ec093 | [
"MIT"
] | 1 | 2021-09-03T08:47:29.000Z | 2021-09-03T08:47:29.000Z | train_SemanticKITTI.py | huixiancheng/RandLA-Net-pytorch | ccf016a3c4b8170bf07db9d732a7b86fed5ec093 | [
"MIT"
] | null | null | null | train_SemanticKITTI.py | huixiancheng/RandLA-Net-pytorch | ccf016a3c4b8170bf07db9d732a7b86fed5ec093 | [
"MIT"
] | null | null | null | # Common
import os
import logging
import warnings
import argparse
import numpy as np
from tqdm import tqdm
# torch
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
# my module
from dataset.semkitti_trainset import Se... | 39.619792 | 112 | 0.631787 |
f684f69b25a6cf84fe914262e9c3847a272c1223 | 4,715 | py | Python | fastparquet/test/test_partition_filters_specialstrings.py | anjsudh/fastparquet | c8457d1726bdc81fd8973a11bcb3166e8413a001 | [
"Apache-2.0"
] | null | null | null | fastparquet/test/test_partition_filters_specialstrings.py | anjsudh/fastparquet | c8457d1726bdc81fd8973a11bcb3166e8413a001 | [
"Apache-2.0"
] | null | null | null | fastparquet/test/test_partition_filters_specialstrings.py | anjsudh/fastparquet | c8457d1726bdc81fd8973a11bcb3166e8413a001 | [
"Apache-2.0"
] | 1 | 2020-11-01T09:17:19.000Z | 2020-11-01T09:17:19.000Z |
import datetime as dt
import os
import shutil
import string
import sys
import numpy as np
import pandas as pd
import pytest
from pandas.tslib import Timestamp
from six import PY2
from fastparquet import write, ParquetFile
from fastparquet.test.util import tempdir
def frame_symbol_dtTrade_type_strike(days=1 * 252,
... | 44.065421 | 96 | 0.494804 |
c2b71073cc699434c26f0fdaca0c3d9daa4dafbb | 8,054 | py | Python | networks/poolnet.py | ParthPatel-ES/Quantized_PoolNet | 926ab290e68f3564a456d69d00665a5615fe20da | [
"MIT"
] | 1 | 2020-10-02T09:53:03.000Z | 2020-10-02T09:53:03.000Z | networks/poolnet.py | ParthPatel-ES/Quantized_PoolNet | 926ab290e68f3564a456d69d00665a5615fe20da | [
"MIT"
] | null | null | null | networks/poolnet.py | ParthPatel-ES/Quantized_PoolNet | 926ab290e68f3564a456d69d00665a5615fe20da | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import math
from torch.autograd import Variable
import numpy as np
from torch.nn.quantized import FloatFunctional
#from .deeplab_resnet import resnet50_locate
config_resnet = {'convert': [[64,256,512,1024,2048],[128,256,256,51... | 34.27234 | 225 | 0.611249 |
31ddbce733b0633868fcff99e332c0bcea606057 | 2,367 | py | Python | deepdialog/nlg/nlg.py | deepdialog/deepdialog | fc94d936e087a173f8e352739f93cf3c12e042be | [
"MIT"
] | 12 | 2019-06-13T14:06:38.000Z | 2021-07-08T07:32:42.000Z | deepdialog/nlg/nlg.py | deepdialog/deepdialog | fc94d936e087a173f8e352739f93cf3c12e042be | [
"MIT"
] | 4 | 2019-05-31T23:55:38.000Z | 2019-06-02T15:57:16.000Z | deepdialog/nlg/nlg.py | deepdialog/deepdialog | fc94d936e087a173f8e352739f93cf3c12e042be | [
"MIT"
] | 8 | 2019-06-13T14:06:40.000Z | 2021-05-14T13:45:31.000Z | # -*- coding: utf-8 -*-
"""NLG Module."""
import os
import random
import yaml
from yaml import Loader
from ..common.system_action import SystemAction
from ..common.dialog_state import DialogState
from ..common.component import Component
from .ext_sysact import load_ext
class NaturalLanguageGenerator(Component):
... | 33.814286 | 75 | 0.574144 |
cc49bc8e8c366482072ac8d9e49056f6af38a738 | 90,006 | py | Python | tests/autoscaling/test_autoscaling_cluster_lib.py | xcorail/paasta | 3f132c73b45fcf0afc31ddb889205ecd9394d4bb | [
"Apache-2.0"
] | null | null | null | tests/autoscaling/test_autoscaling_cluster_lib.py | xcorail/paasta | 3f132c73b45fcf0afc31ddb889205ecd9394d4bb | [
"Apache-2.0"
] | 4 | 2021-02-08T20:42:08.000Z | 2021-06-02T00:51:04.000Z | tests/autoscaling/test_autoscaling_cluster_lib.py | eric-erki/An-open-distributed-platform-as-a-service | 6769c5601685deb1017910ab8d09109e8e998892 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 44.513353 | 119 | 0.631691 |
46def076f1c7e6ccba85afc5b44198a16c447a51 | 161 | py | Python | Functions/main.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | null | null | null | Functions/main.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | null | null | null | Functions/main.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | 2 | 2019-01-27T16:59:48.000Z | 2019-01-29T13:07:40.000Z | #simple function
def Welcome():
print("Welcome to 2019")
#Main function defintion
def main():
print("Main would be printed first")
Welcome()
main()
| 16.1 | 40 | 0.677019 |
5f70cbdfd538de21fba2c264f452a9b98564b172 | 5,393 | py | Python | rocon_client_sdk_py/apis/api_configuration.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | null | null | null | rocon_client_sdk_py/apis/api_configuration.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | 1 | 2021-06-08T21:01:30.000Z | 2021-06-08T21:01:30.000Z | rocon_client_sdk_py/apis/api_configuration.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | null | null | null | import pydash
from PIL import Image, ImageFilter
import io
import json
class ApiConfiguration():
def __init__(self, httpclient):
self._httpclient = httpclient
@property
def request(self):
return self._httpclient.request()
def get_url(self, sub_url):
url = self._httpclient.conf... | 29.151351 | 115 | 0.544039 |
6e24222a1040c8a8afef74b5a42c0ff06fe37186 | 17,577 | py | Python | nemo/collections/nlp/models/token_classification/punctuation_capitalization_model.py | antrikshmisri/NeMo | 17fc2541172dd3d781bfa0b5a1fa41576d4bfe21 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/token_classification/punctuation_capitalization_model.py | antrikshmisri/NeMo | 17fc2541172dd3d781bfa0b5a1fa41576d4bfe21 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/models/token_classification/punctuation_capitalization_model.py | antrikshmisri/NeMo | 17fc2541172dd3d781bfa0b5a1fa41576d4bfe21 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA 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 appli... | 42.766423 | 226 | 0.664107 |
2c06141a027d09ac5bf3cf4383ca8d0598e22f27 | 5,477 | py | Python | utils/raster_tools.py | dgketchum/MT_Rsense | 072238fbca19f2887e29c1a48111d817e47243a3 | [
"Apache-2.0"
] | 5 | 2019-10-16T13:09:49.000Z | 2022-03-31T18:23:51.000Z | utils/raster_tools.py | dgketchum/MT_Rsense | 072238fbca19f2887e29c1a48111d817e47243a3 | [
"Apache-2.0"
] | null | null | null | utils/raster_tools.py | dgketchum/MT_Rsense | 072238fbca19f2887e29c1a48111d817e47243a3 | [
"Apache-2.0"
] | 1 | 2022-03-18T17:02:03.000Z | 2022-03-18T17:02:03.000Z | # ===============================================================================
# Copyright 2017 dgketchum
#
# 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... | 33.601227 | 105 | 0.652364 |
95de6633e4b2248563ac6bc6fa5e3086d03a9075 | 1,546 | py | Python | run_tests.py | LisaDawn/TextBlob | 6b76c3f568a3cea16389d6bdb1b3e5a9dc6043e9 | [
"MIT"
] | 2 | 2015-03-10T14:33:16.000Z | 2015-03-10T14:33:18.000Z | run_tests.py | LisaDawn/TextBlob | 6b76c3f568a3cea16389d6bdb1b3e5a9dc6043e9 | [
"MIT"
] | null | null | null | run_tests.py | LisaDawn/TextBlob | 6b76c3f568a3cea16389d6bdb1b3e5a9dc6043e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
The main test runner script.
Usage: ::
python run_tests.py
Skip slow tests
python run_tests.py fast
When there's no Internet
python run_tests.py no-internet
'''
from __future__ import unicode_literals
import nose
import sys
from text.compat import PY2
PY2... | 25.766667 | 74 | 0.647477 |
692970a03fa6d63dd1530dd583f1463e1ff0786d | 655 | py | Python | src/tests/common/test_common_exporter.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/tests/common/test_common_exporter.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/tests/common/test_common_exporter.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | import pytest
from pretalx.common.exporter import BaseExporter
def test_common_base_exporter_raises_proper_exceptions():
exporter = BaseExporter(None)
with pytest.raises(NotImplementedError):
exporter.identifier
with pytest.raises(NotImplementedError):
exporter.verbose_name
with pytes... | 29.772727 | 57 | 0.738931 |
ef45545aec1132dadab0a968bc5c6a91d61e2315 | 1,197 | py | Python | configs/detection/fsce/coco/fsce_r101_fpn_coco_10shot-fine-tuning.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | configs/detection/fsce/coco/fsce_r101_fpn_coco_10shot-fine-tuning.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | configs/detection/fsce/coco/fsce_r101_fpn_coco_10shot-fine-tuning.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | _base_ = [
'../../_base_/datasets/fine_tune_based/few_shot_coco.py',
'../../_base_/schedules/schedule.py', '../fsce_r101_fpn.py',
'../../_base_/default_runtime.py'
]
# classes splits are predefined in FewShotCocoDataset
# FewShotCocoDefaultDataset predefine ann_cfg for model reproducibility
data = dict(
... | 39.9 | 79 | 0.718463 |
b2acaf267cacd565182cc9fd55c96d2f61698f72 | 2,550 | py | Python | boilerplate/config/settings/base.py | andre-dasilva/django-boilerplate | 2bce4623053a3993bf4ba897109de8ea3ce0fd0f | [
"MIT"
] | null | null | null | boilerplate/config/settings/base.py | andre-dasilva/django-boilerplate | 2bce4623053a3993bf4ba897109de8ea3ce0fd0f | [
"MIT"
] | null | null | null | boilerplate/config/settings/base.py | andre-dasilva/django-boilerplate | 2bce4623053a3993bf4ba897109de8ea3ce0fd0f | [
"MIT"
] | null | null | null | from pathlib import Path
import environ
# Deployment checklist
# https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
env = environ.Env(DEBUG=(bool, False))
env.read_env(env.str('ENV_PATH', '.dev.env'))
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
SECRET_KEY = env('SECRET_KEY')
... | 22.566372 | 91 | 0.680392 |
21b579ca66eed24926c67ee431c2e3efe997f6f3 | 4,578 | py | Python | senlin/tests/apiv1/shared.py | tengqm/senlin | aa59c55c098abb13590bc4308c753338ce4a70f4 | [
"Apache-2.0"
] | 2 | 2015-02-11T23:02:13.000Z | 2021-03-26T06:39:58.000Z | senlin/tests/apiv1/shared.py | tengqm/senlin | aa59c55c098abb13590bc4308c753338ce4a70f4 | [
"Apache-2.0"
] | 2 | 2015-01-19T13:40:47.000Z | 2015-03-04T07:06:07.000Z | senlin/tests/apiv1/shared.py | tengqm/senlin | aa59c55c098abb13590bc4308c753338ce4a70f4 | [
"Apache-2.0"
] | 5 | 2015-01-13T14:53:04.000Z | 2015-03-13T02:54:06.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 34.681818 | 75 | 0.651376 |
e3159ef3e6a42a814b4b683dd559345428b7096a | 6,502 | py | Python | crabageprediction/venv/Lib/site-packages/pandas/tests/io/parser/common/test_ints.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 3 | 2021-11-23T05:35:28.000Z | 2022-02-10T08:05:53.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/io/parser/common/test_ints.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 1 | 2022-03-08T02:15:07.000Z | 2022-03-08T02:15:07.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/io/parser/common/test_ints.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 4 | 2021-11-23T05:36:16.000Z | 2021-11-23T05:39:33.000Z | """
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
# GH#43650: Some expected failures with the pyarrow e... | 30.101852 | 87 | 0.629806 |
50127fac1087e6795c028aa6c9541440faa6bd64 | 158 | py | Python | docker/auth/__init__.py | mmerickel/docker-py | 008730c670afb2f88c7db308901586fb24f1a60c | [
"Apache-2.0"
] | null | null | null | docker/auth/__init__.py | mmerickel/docker-py | 008730c670afb2f88c7db308901586fb24f1a60c | [
"Apache-2.0"
] | null | null | null | docker/auth/__init__.py | mmerickel/docker-py | 008730c670afb2f88c7db308901586fb24f1a60c | [
"Apache-2.0"
] | null | null | null | from .auth import (
INDEX_NAME,
INDEX_URL,
encode_header,
load_config,
resolve_authconfig,
resolve_repository_name,
) # flake8: noqa
| 17.555556 | 28 | 0.683544 |
8aa1a2f040742197ba802fd1c3edd7e6472dc5de | 625 | py | Python | wazimap_ng/datasets/models/metadata.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | wazimap_ng/datasets/models/metadata.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | wazimap_ng/datasets/models/metadata.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | from django.db import models
from .licence import Licence
from .dataset import Dataset
from wazimap_ng.general.models import BaseModel
class MetaData(BaseModel):
source = models.CharField(max_length=60, null=False, blank=True)
url = models.URLField(null=True, blank=True)
description = models.TextField(bla... | 34.722222 | 69 | 0.728 |
0056a8dc6bd28f4ecd6e072969f5e9a90d1d72cf | 166,271 | py | Python | bpytop.py | jasonpfi/bpytop | 73eb150abe3150082488acd00f3968f330c2dc89 | [
"Apache-2.0"
] | 1 | 2020-08-17T14:20:29.000Z | 2020-08-17T14:20:29.000Z | bpytop.py | jasonpfi/bpytop | 73eb150abe3150082488acd00f3968f330c2dc89 | [
"Apache-2.0"
] | null | null | null | bpytop.py | jasonpfi/bpytop | 73eb150abe3150082488acd00f3968f330c2dc89 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member
# indent = tab
# tab-size = 4
# Copyright 2020 Aristocratos (jakob@qvantnet.com)
# 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... | 37.006677 | 541 | 0.630368 |
0c5623a50ad1c5abd66976e234d6fa2c2863062f | 2,150 | py | Python | homeassistant/scripts/keyring.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 3 | 2020-10-23T14:39:11.000Z | 2021-02-17T14:40:17.000Z | homeassistant/scripts/keyring.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 3 | 2021-02-08T20:54:46.000Z | 2021-09-08T02:30:04.000Z | homeassistant/scripts/keyring.py | tecknicaltom/home-assistant | 5c50fa34056ba2cd0c91c06cbb6a9c894b4be92e | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Script to get, set and delete secrets stored in the keyring."""
import argparse
import getpass
import os
from homeassistant.util.yaml import _SECRET_NAMESPACE
# mypy: allow-untyped-defs
REQUIREMENTS = ["keyring==19.2.0", "keyrings.alt==3.1.1"]
def run(args):
"""Handle keyring script."""
parser = argpar... | 34.126984 | 86 | 0.627442 |
cae210dcfa386df7f4ce867f35c5078c9c05499a | 6,120 | py | Python | lbry/tests/integration/test_sync.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | lbry/tests/integration/test_sync.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | lbry/tests/integration/test_sync.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | from unittest import mock
from torba.orchstr8.node import WalletNode, SPVNode
from torba.testcase import AsyncioTestCase
from lbry.conf import Config
from lbry.wallet import LbryWalletManager, RegTestLedger
from lbry.extras.daemon.Daemon import Daemon
from lbry.extras.daemon.Components import WalletComponent
from lbr... | 53.217391 | 105 | 0.748693 |
b3befd6984983e0b70cf2572d6c02d1153fd2a29 | 45,240 | py | Python | tensorflow/python/compiler/tensorrt/trt_convert.py | jim-meyer/tensorflow | 37eafe0e7463fa72a45624206b1b94b36021df53 | [
"Apache-2.0"
] | 1 | 2019-07-15T08:40:24.000Z | 2019-07-15T08:40:24.000Z | tensorflow/python/compiler/tensorrt/trt_convert.py | jim-meyer/tensorflow | 37eafe0e7463fa72a45624206b1b94b36021df53 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compiler/tensorrt/trt_convert.py | jim-meyer/tensorflow | 37eafe0e7463fa72a45624206b1b94b36021df53 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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.201493 | 80 | 0.726149 |
eb01ae3468bd6b31ed7d12e8625808fcc8c636f1 | 10,414 | py | Python | src/deepke/name_entity_re/few_shot/module/train.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | null | null | null | src/deepke/name_entity_re/few_shot/module/train.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | null | null | null | src/deepke/name_entity_re/few_shot/module/train.py | johncolezhang/DeepKE | ea4552ec42cb003a835f00fc14fb454f9a9a7183 | [
"MIT"
] | null | null | null | import torch
from torch import optim
from tqdm import tqdm
from ..utils import convert_preds_to_outputs, write_predictions
import random
class Trainer(object):
def __init__(self, train_data=None, dev_data=None, test_data=None, model=None, process=None, args=None, logger=None, loss=None, metrics=None, writer=None) ... | 49.590476 | 167 | 0.568466 |
8c1e5de81ecf8c133effa37118785407b2b36348 | 4,046 | py | Python | app/env/lib/python3.7/site-packages/twilio/rest/pricing/v2/voice/__init__.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 2 | 2018-12-09T22:59:11.000Z | 2018-12-09T22:59:15.000Z | app/env/lib/python3.7/site-packages/twilio/rest/pricing/v2/voice/__init__.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 10 | 2019-11-25T16:54:39.000Z | 2022-02-10T08:29:51.000Z | app/env/lib/python3.7/site-packages/twilio/rest/pricing/v2/voice/__init__.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 3 | 2019-01-13T19:51:42.000Z | 2019-01-19T16:52:50.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
from twilio.rest.pricing.v2.voice.country import Country... | 25.130435 | 104 | 0.600099 |
94d14e9607750281392e19c90f64d25d811af79d | 2,012 | py | Python | Remove-Duplicate-Files/removeDuplicateFiles.py | elishahyousaf/Awesome-Python-Scripts | d516584517de2d94de60852f73d8f1831524fa19 | [
"MIT"
] | 1,026 | 2018-10-02T18:51:12.000Z | 2022-03-31T13:45:14.000Z | Remove-Duplicate-Files/removeDuplicateFiles.py | elishahyousaf/Awesome-Python-Scripts | d516584517de2d94de60852f73d8f1831524fa19 | [
"MIT"
] | 164 | 2018-10-02T18:37:40.000Z | 2021-11-18T13:29:54.000Z | Remove-Duplicate-Files/removeDuplicateFiles.py | elishahyousaf/Awesome-Python-Scripts | d516584517de2d94de60852f73d8f1831524fa19 | [
"MIT"
] | 521 | 2018-10-02T18:15:40.000Z | 2022-03-26T12:10:15.000Z | import os
import hashlib
# function to compute SHA-1 hash of a file
def computeFileHash(fileName):
genHash = hashlib.sha1()
with open(fileName, 'rb') as file:
block = 0
while block!=b'':
block = file.read(1024)
genHash.update(block)
file.close()
return genHash.he... | 33.533333 | 73 | 0.614811 |
4b7a28284335464a16cbee7ef6beea98298072a9 | 127 | py | Python | test/tk/listTK/shape/test_bad_input.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2020-04-10T08:14:43.000Z | 2020-04-10T08:14:43.000Z | test/tk/listTK/shape/test_bad_input.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2016-11-30T20:37:27.000Z | 2016-12-12T11:55:50.000Z | test/tk/listTK/shape/test_bad_input.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2019-12-18T07:56:00.000Z | 2019-12-18T07:56:00.000Z | from plot.tk.listTK import shape
def test():
a = 0
solution = []
answer = shape(a)
assert answer == solution
| 14.111111 | 32 | 0.598425 |
8115c29f3e7bc0cd607e33d252bf105a093264f6 | 83 | py | Python | src/homework/main_homework3.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | src/homework/main_homework3.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | src/homework/main_homework3.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | from src.homework.homework3 import main1
#make a call to main1 function to run it
| 20.75 | 40 | 0.795181 |
5bfde7362567f5e1c1b91efbee6bdcd18b641b48 | 1,320 | py | Python | ifaxbotcovid/parser/lib/regions.py | a-sia-now/ifaxbotcovid | 316273c26a81c466605e9c92a8b90b8e621249ea | [
"MIT"
] | null | null | null | ifaxbotcovid/parser/lib/regions.py | a-sia-now/ifaxbotcovid | 316273c26a81c466605e9c92a8b90b8e621249ea | [
"MIT"
] | null | null | null | ifaxbotcovid/parser/lib/regions.py | a-sia-now/ifaxbotcovid | 316273c26a81c466605e9c92a8b90b8e621249ea | [
"MIT"
] | null | null | null | """
Задает словарь изменений в названиях республик РФ, АО
и городов федерального значения: находит регион и переписывает
в нужной форме и падеже.
Для областей и краёв окончания меняются отдельно.
"""
regions = {
'Адыг': 'Адыгее',
# Алтай - первый раз
'Республика Алтай': 'Республике Алтай',
# Алтай - вт... | 29.333333 | 65 | 0.625 |
4d1d63c03c3a22f3dc9b3c9bf5e19bb6ba0f98b0 | 533 | py | Python | LeetCode/Search2D.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | 1 | 2021-02-27T06:12:55.000Z | 2021-02-27T06:12:55.000Z | LeetCode/Search2D.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | 1 | 2021-02-02T08:52:17.000Z | 2021-02-03T08:19:12.000Z | LeetCode/Search2D.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | null | null | null | def search2Dmatrix(arr, target):
m = len(arr)
n = len(arr[0])
row = -1
for i in range(0, m):
if arr[i][0] <= target and arr[i][n-1] >= target:
row = i
break
if row == -1:
return False
for i in range(0, len(arr[row])):
if arr[row][i] == target:
... | 21.32 | 103 | 0.476548 |
65842c3094b706a469f34322cfde3461f1d14caa | 7,546 | py | Python | solutions/PE419.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | 1 | 2022-01-22T19:48:44.000Z | 2022-01-22T19:48:44.000Z | solutions/PE419.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | null | null | null | solutions/PE419.py | KerimovEmil/ProjectEuler | bc9cb682181c1ac7889ee57c36d32beae7b441a8 | [
"MIT"
] | null | null | null | """
The look and say sequence goes 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ...
The sequence starts with 1 and all other members are obtained by describing the previous member in terms of consecutive digits.
It helps to do this out loud:
1 is 'one one' → 11
11 is 'two ones' → 21
21 is 'one two and one one... | 43.872093 | 127 | 0.576862 |
c432b9879a378df5728ef10cd3fcfa66f466a988 | 1,619 | py | Python | software/jetson/pyuarm/pyuarm/protocol.py | abstractguy/TSO_project | 1130e6fb081d1486ff15339a9757c46a927a2965 | [
"BSD-2-Clause"
] | 1 | 2021-06-06T14:12:32.000Z | 2021-06-06T14:12:32.000Z | software/jetson/pyuarm/pyuarm/protocol.py | abstractguy/TSO_project | 1130e6fb081d1486ff15339a9757c46a927a2965 | [
"BSD-2-Clause"
] | 6 | 2021-04-06T12:35:34.000Z | 2022-03-12T00:58:16.000Z | software/jetson/pyuarm/pyuarm/protocol.py | abstractguy/TSO_project | 1130e6fb081d1486ff15339a9757c46a927a2965 | [
"BSD-2-Clause"
] | 2 | 2020-03-05T00:09:48.000Z | 2021-06-03T20:06:03.000Z | # parameters
## SERVO NUMBER INDEX
SERVO_BOTTOM = 0
SERVO_LEFT = 1
SERVO_RIGHT = 2
SERVO_HAND = 3
## CALIBRATION FLAG
CONFIRM_FLAG = 0x80
CALIBRATION_FLAG = 10
CALIBRATION_LINEAR_FLAG = 11
CALIBRATION_SERVO_FLAG = 12
CALIBRATION_STRETCH_FLAG = 13
## OFFSET EEPROM ADDRESS
LINEAR_INTERCEPT_START_ADDRESS = 70
LINEAR_SL... | 27.913793 | 48 | 0.56084 |
ff750e91a80bbf425ddeea1f35f991e49ba4b672 | 1,273 | py | Python | onedegree/api/v1/filters.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | null | null | null | onedegree/api/v1/filters.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | 2 | 2015-10-27T10:12:36.000Z | 2015-11-01T05:21:06.000Z | onedegree/api/v1/filters.py | ace-han/onedegree | ffa30c518a0035509289c36e70316c1b660df3fd | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields.related import ForeignObjectRel
from rest_framework.filters import OrderingFilter
class RelatedOrderingFilter(OrderingFilter):
"""
Extends OrderingFilter to support ordering by fields in related models
using the Django ORM _... | 37.441176 | 75 | 0.648861 |
0d5e590a1da9e1387f52045bb5ab522217d5e7c1 | 1,370 | py | Python | heimdall/attribute.py | robindboer/heimdall | 2159af3f8e56d7f7f980b2cb69dbb4d9e1ad1405 | [
"MIT"
] | 1 | 2018-01-11T13:43:38.000Z | 2018-01-11T13:43:38.000Z | heimdall/attribute.py | robindboer/heimdall | 2159af3f8e56d7f7f980b2cb69dbb4d9e1ad1405 | [
"MIT"
] | null | null | null | heimdall/attribute.py | robindboer/heimdall | 2159af3f8e56d7f7f980b2cb69dbb4d9e1ad1405 | [
"MIT"
] | null | null | null | class BaseAttribute(object):
def __init__(self, required=False):
self.required = required
def validate(self, data):
raise NotImplementedError()
class StringAttribute(BaseAttribute):
def validate(self, data):
if not isinstance(data, str):
raise Exception("Item is not a ... | 26.862745 | 55 | 0.644526 |
fa089ed1e3d8e397c64c37a055672c14c9ae8fc7 | 2,836 | py | Python | utils/logger.py | tzodge/PS-FCN-top_down | 834511680881cc515cfd374ac4d98a59c0ae08ab | [
"MIT"
] | null | null | null | utils/logger.py | tzodge/PS-FCN-top_down | 834511680881cc515cfd374ac4d98a59c0ae08ab | [
"MIT"
] | null | null | null | utils/logger.py | tzodge/PS-FCN-top_down | 834511680881cc515cfd374ac4d98a59c0ae08ab | [
"MIT"
] | null | null | null | import datetime, time
import os
import numpy as np
import torch
import torchvision.utils as vutils
from . import utils
class Logger(object):
def __init__(self, args):
self.times = {'init': time.time()}
self._checkPath(args)
self.args = args
self.printArgs()
def printArgs(self):... | 42.969697 | 96 | 0.57299 |
444514eff5dd1f06a54c51c3a934a0861e923021 | 2,505 | py | Python | nemo/utils/lightning_logger_patch.py | blisc/NeMo | fadeb45c84d6b323d78e30475538455a88b7c151 | [
"Apache-2.0"
] | 2 | 2021-06-23T19:16:59.000Z | 2022-02-23T18:49:07.000Z | nemo/utils/lightning_logger_patch.py | blisc/NeMo | fadeb45c84d6b323d78e30475538455a88b7c151 | [
"Apache-2.0"
] | null | null | null | nemo/utils/lightning_logger_patch.py | blisc/NeMo | fadeb45c84d6b323d78e30475538455a88b7c151 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA 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 appli... | 41.75 | 120 | 0.736128 |
65d53901cdb766e99ffcbcca97f6ed6418e6b501 | 10,305 | py | Python | qiskit/pulse/parser.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 1 | 2021-10-05T11:56:53.000Z | 2021-10-05T11:56:53.000Z | qiskit/pulse/parser.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 24 | 2021-01-27T08:20:27.000Z | 2021-07-06T09:42:28.000Z | qiskit/pulse/parser.py | gadial/qiskit-terra | 0fc83f44a6e80969875c738b2cee7bc33223e45f | [
"Apache-2.0"
] | 4 | 2021-10-05T12:07:27.000Z | 2022-01-28T18:37:28.000Z | # 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... | 31.805556 | 95 | 0.570985 |
9c371ed99eb060cfd399c99b473e0d597d9b4ec1 | 150 | py | Python | setup.py | klassen-software-solutions/pyutil | a0ddaa15791537c92b78ceb0120d44a4e907b8b6 | [
"MIT"
] | null | null | null | setup.py | klassen-software-solutions/pyutil | a0ddaa15791537c92b78ceb0120d44a4e907b8b6 | [
"MIT"
] | 9 | 2020-01-27T17:56:22.000Z | 2020-02-04T15:35:15.000Z | setup.py | klassen-software-solutions/pyutil | a0ddaa15791537c92b78ceb0120d44a4e907b8b6 | [
"MIT"
] | 1 | 2022-02-05T09:08:02.000Z | 2022-02-05T09:08:02.000Z | from setuptools import setup, find_namespace_packages
setup(
python_requires='>=3.7',
packages=find_namespace_packages(include=["kss.*"]),
)
| 21.428571 | 56 | 0.74 |
8d19614586eb0f7b5a07e451051214a241793234 | 981 | py | Python | app/core/admin.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | null | null | null | app/core/admin.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | 6 | 2021-03-19T00:29:34.000Z | 2021-09-22T18:39:45.000Z | app/core/admin.py | umtdemr/recipe-app-api | e28b2a704106240b47672c4aa5fe2ac169adb002 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email', '... | 26.513514 | 64 | 0.528033 |
006cd495c6a80f22abfdec4c9c136a210bc96a6a | 5,094 | py | Python | app.py | skbro/scrapePoint | 40453b3ead96286b7d82eb7358e502b61d5f0054 | [
"MIT"
] | null | null | null | app.py | skbro/scrapePoint | 40453b3ead96286b7d82eb7358e502b61d5f0054 | [
"MIT"
] | 1 | 2018-12-07T13:34:33.000Z | 2018-12-07T13:34:33.000Z | app.py | skbro/scrapePoint | 40453b3ead96286b7d82eb7358e502b61d5f0054 | [
"MIT"
] | null | null | null | # Importing Modules
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from bs4 import BeautifulSoup
import os
import pdfkit
# Getting All site Information
http = urllib3.PoolManager()
url = "https://www.javatpoint.com"
r = http.request('GET', url)
soup = BeautifulSoup(r.data, 'html.p... | 30.872727 | 144 | 0.588339 |
db880112f0bb1ed7161f402392eed92f2c7e2897 | 2,800 | py | Python | tests/api_tests.py | HusseinKabbout/sogis-landreg-service | 98cc6c108c87aa5b59d2473ce20311eecbcbfe0c | [
"MIT"
] | null | null | null | tests/api_tests.py | HusseinKabbout/sogis-landreg-service | 98cc6c108c87aa5b59d2473ce20311eecbcbfe0c | [
"MIT"
] | null | null | null | tests/api_tests.py | HusseinKabbout/sogis-landreg-service | 98cc6c108c87aa5b59d2473ce20311eecbcbfe0c | [
"MIT"
] | 1 | 2020-04-24T12:00:50.000Z | 2020-04-24T12:00:50.000Z | import os
import unittest
from urllib.parse import urlparse, parse_qs, unquote_plus
from flask import Response, json
from flask.testing import FlaskClient
from flask_jwt_extended import JWTManager, create_access_token
import server
class ApiTestCase(unittest.TestCase):
"""Test case for server API"""
def se... | 39.43662 | 134 | 0.619286 |
bc93e3f62a78a411c98d8e3eed1fcfb8532eb4ad | 8,281 | py | Python | src/sage/calculus/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/calculus/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/calculus/all.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z |
from .calculus import maxima as maxima_calculus
from .calculus import (laplace, inverse_laplace,
limit, lim)
from .integration import numerical_integral, monte_carlo_integral
integral_numerical = numerical_integral
from .interpolation import spline, Spline
from .functional import (diff, deriva... | 35.540773 | 98 | 0.608864 |
4b5b2c38d2acda01d5c586f17982694eaa1e4d76 | 923 | py | Python | scripts/rejoin.py | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | scripts/rejoin.py | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | scripts/rejoin.py | mega65dev/rom-assembler | 1670a56a8246dcdcc18e83b345d577eba686cf32 | [
"MIT"
] | null | null | null | # ***************************************************************************************************************
# ***************************************************************************************************************
#
# Name: rejoin.py
# Purpose: Put the code back together
# Created:... | 43.952381 | 113 | 0.325027 |
346a9a87de92110e1389c27a4f07f67dff2c8552 | 27,859 | py | Python | altair_transform/utils/_parser_Parser_parsetab.py | altair-viz/altair-transform | b65bf854de1e80f931e063d8fb2ec938773826fb | [
"MIT"
] | 29 | 2019-07-19T08:53:34.000Z | 2022-01-19T14:07:36.000Z | altair_transform/utils/_parser_Parser_parsetab.py | altair-viz/altair-transform | b65bf854de1e80f931e063d8fb2ec938773826fb | [
"MIT"
] | 13 | 2019-07-19T03:33:07.000Z | 2021-06-29T15:34:19.000Z | altair_transform/utils/_parser_Parser_parsetab.py | altair-viz/altair-transform | b65bf854de1e80f931e063d8fb2ec938773826fb | [
"MIT"
] | 11 | 2019-07-19T02:48:35.000Z | 2021-11-01T00:07:41.000Z |
# _parser_Parser_parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'rightQUESTIONleftLOGICAL_ORleftLOGICAL_ANDleftBITWISE_ORleftBITWISE_XORleftBITWISE_ANDleftEQUALNEQUALIDENTNIDENTleftLESSLESS_EQUALGREATERGREATER_EQUALlef... | 293.252632 | 15,889 | 0.613374 |
a31d14c94847b679184436033df848db196f1cb6 | 1,760 | py | Python | myenum.py | cu2/zandagort | 81ffd6afffc3b3ec39f3a731a931475871ba2897 | [
"CC-BY-3.0"
] | 8 | 2015-01-20T15:21:52.000Z | 2020-12-29T22:11:38.000Z | myenum.py | cu2/zandagort | 81ffd6afffc3b3ec39f3a731a931475871ba2897 | [
"CC-BY-3.0"
] | null | null | null | myenum.py | cu2/zandagort | 81ffd6afffc3b3ec39f3a731a931475871ba2897 | [
"CC-BY-3.0"
] | 9 | 2015-01-16T14:35:35.000Z | 2021-03-16T16:06:55.000Z | """
Custom Enumeration
Has the following properties:
- same value from same enum is identic
- same value from different enum is different
- type of enum value can be checked (enum "contains" enum value)
- hashable
- serializable
- readable in code
- __str__ and __repr__ contains enum type and name
Usage:
class Animal... | 25.882353 | 95 | 0.644318 |
0cbfc11fcf4ba66b766edb57990d3b265680980b | 1,169 | py | Python | docs/web/howto/listings/client/gzipdecoder.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | 1 | 2020-12-18T06:32:58.000Z | 2020-12-18T06:32:58.000Z | docs/web/howto/listings/client/gzipdecoder.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | 3 | 2015-08-20T09:05:57.000Z | 2015-11-10T08:30:51.000Z | docs/web/howto/listings/client/gzipdecoder.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet.protocol import Protocol
from twisted.web.client import Agent, ContentDecoderAgent, GzipDecoder
class BeginningPrinter(Protocol):
def __init__(self, finished):
self.finishe... | 27.186047 | 73 | 0.685201 |
0805fc6ac1928d57f7f27d5f59015a3e87e87df6 | 13,819 | py | Python | py/model.py | jameswalmsley/phabulous | e3b6e0236ed03658f5b302e8c34a4fd97c36e89b | [
"0BSD"
] | null | null | null | py/model.py | jameswalmsley/phabulous | e3b6e0236ed03658f5b302e8c34a4fd97c36e89b | [
"0BSD"
] | null | null | null | py/model.py | jameswalmsley/phabulous | e3b6e0236ed03658f5b302e8c34a4fd97c36e89b | [
"0BSD"
] | null | null | null | import utils
from pprint import pprint
from pprint import pformat
from datetime import datetime
import unidiff
phid_cache = {}
class Repo:
raw = None
phid = None
staging = None
def __init__(self, raw):
self.raw = raw
self.phid = raw['phid']
if raw['staging']['supported']:
... | 24.944043 | 91 | 0.568058 |
c24402ae68471b2c6a700a4c61ac58116a190363 | 6,041 | py | Python | hasher-matcher-actioner/hmalib/lambdas/unified_indexer.py | garnesen/ThreatExchange | a8164cf9bfeccc7b8d47a1c1de573b1a446ca2a4 | [
"BSD-3-Clause"
] | 997 | 2015-03-13T18:04:03.000Z | 2022-03-30T12:09:10.000Z | hasher-matcher-actioner/hmalib/lambdas/unified_indexer.py | garnesen/ThreatExchange | a8164cf9bfeccc7b8d47a1c1de573b1a446ca2a4 | [
"BSD-3-Clause"
] | 444 | 2015-03-26T17:28:49.000Z | 2022-03-28T19:34:05.000Z | hasher-matcher-actioner/hmalib/lambdas/unified_indexer.py | garnesen/ThreatExchange | a8164cf9bfeccc7b8d47a1c1de573b1a446ca2a4 | [
"BSD-3-Clause"
] | 294 | 2015-03-13T22:19:43.000Z | 2022-03-30T08:42:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
import json
import typing as t
import functools
from collections import defaultdict
from urllib.parse import unquote_plus
from threatexchange.signal_type.md5 import VideoMD5Signal
from threatexchange.signal_type.pdq import PdqSignal
fro... | 35.745562 | 98 | 0.702864 |
0b15f8eadc7b63befdf0fac0d6357c0bc3ecf915 | 4,545 | py | Python | haco/DIDrive_core/utils/simulator_utils/carla_agents/navigation/basic_agent.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 21 | 2022-02-15T10:11:54.000Z | 2022-03-24T17:44:29.000Z | haco/DIDrive_core/utils/simulator_utils/carla_agents/navigation/basic_agent.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | null | null | null | haco/DIDrive_core/utils/simulator_utils/carla_agents/navigation/basic_agent.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 3 | 2022-02-22T11:11:43.000Z | 2022-03-17T17:58:44.000Z | # Copyright (c) # Copyright (c) 2018-2020 CVC.
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
""" This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles.
The agent also responds to traffic l... | 36.653226 | 122 | 0.662266 |
f114cea00ce318160282689f942e82453dc93521 | 1,755 | py | Python | aliyun-python-sdk-alidns/aliyunsdkalidns/request/v20150109/DescribePdnsAccountSummaryRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-alidns/aliyunsdkalidns/request/v20150109/DescribePdnsAccountSummaryRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-alidns/aliyunsdkalidns/request/v20150109/DescribePdnsAccountSummaryRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.1 | 91 | 0.761823 |
b0cf0739f9e27480bf7dc859ac72913fd9a91862 | 446 | py | Python | data/scripts/templates/object/mobile/shared_giant_horned_krevol.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_giant_horned_krevol.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_giant_horned_krevol.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_giant_horned_krevol.iff"
result.attribute_template_id = 9
res... | 26.235294 | 65 | 0.730942 |
51b9680723af9e1507897bca1ceb69c2aae1eecc | 1,022 | py | Python | runlike/runlike.py | AlexRogalskiy/runlike | 0abc08c5214c80a86a5dd354d79479e8ac870612 | [
"BSD-2-Clause-FreeBSD"
] | 668 | 2017-09-04T19:54:50.000Z | 2022-03-27T01:26:25.000Z | runlike/runlike.py | AlexRogalskiy/runlike | 0abc08c5214c80a86a5dd354d79479e8ac870612 | [
"BSD-2-Clause-FreeBSD"
] | 64 | 2017-09-22T11:12:19.000Z | 2022-03-21T19:54:58.000Z | runlike/runlike.py | AlexRogalskiy/runlike | 0abc08c5214c80a86a5dd354d79479e8ac870612 | [
"BSD-2-Clause-FreeBSD"
] | 74 | 2017-10-03T10:52:15.000Z | 2022-03-24T14:58:02.000Z | #!/usr/bin/env python
import click
try:
from .inspector import Inspector
except ValueError:
from inspector import Inspector
@click.command(
help="Shows command line necessary to run copy of existing Docker container.")
@click.argument("container", required=False )
@click.option(
"--no-name",
is_... | 24.926829 | 82 | 0.64775 |
8cbcf5395a8bf367475d0fdb4e7b0ff4729de622 | 798 | py | Python | app/app/urls.py | stevethucpham/demo-django-drf-nested-router | 0d3fa670baca0113c7ab69a96cb1e1ae78217494 | [
"Apache-2.0"
] | 2 | 2021-07-07T20:05:23.000Z | 2022-01-25T18:48:48.000Z | app/app/urls.py | stevethucpham/demo-django-drf-nested-router | 0d3fa670baca0113c7ab69a96cb1e1ae78217494 | [
"Apache-2.0"
] | null | null | null | app/app/urls.py | stevethucpham/demo-django-drf-nested-router | 0d3fa670baca0113c7ab69a96cb1e1ae78217494 | [
"Apache-2.0"
] | 1 | 2021-11-30T07:12:11.000Z | 2021-11-30T07:12:11.000Z | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 33.25 | 77 | 0.700501 |
94a9ce9d5c64abdbd43a57307900df6e131f21ee | 406 | py | Python | venv/Scripts/pip-script.py | hertai86/GIEAA | a0f23e018a442af5c8fe0f2b89d07a0ae3f0d9fd | [
"CC-BY-4.0"
] | null | null | null | venv/Scripts/pip-script.py | hertai86/GIEAA | a0f23e018a442af5c8fe0f2b89d07a0ae3f0d9fd | [
"CC-BY-4.0"
] | null | null | null | venv/Scripts/pip-script.py | hertai86/GIEAA | a0f23e018a442af5c8fe0f2b89d07a0ae3f0d9fd | [
"CC-BY-4.0"
] | null | null | null | #!C:\Users\hp\PycharmProjects\GIEAA\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
... | 31.230769 | 69 | 0.665025 |
37930b77aa63b76e94f0a2c65f31dcf30b014ee8 | 2,314 | py | Python | lib/gcc/mingw32/4.9.3/libstdc++.dll.a-gdb.py | hecate-xw/MinGW | bd215c93f9bf41fa8f00b29baae956a52529e769 | [
"MIT"
] | null | null | null | lib/gcc/mingw32/4.9.3/libstdc++.dll.a-gdb.py | hecate-xw/MinGW | bd215c93f9bf41fa8f00b29baae956a52529e769 | [
"MIT"
] | null | null | null | lib/gcc/mingw32/4.9.3/libstdc++.dll.a-gdb.py | hecate-xw/MinGW | bd215c93f9bf41fa8f00b29baae956a52529e769 | [
"MIT"
] | null | null | null | # -*- python -*-
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | 37.934426 | 72 | 0.717373 |
e27f2a4c36cdc6e99292a0782bd85a419e8b6229 | 33,310 | py | Python | onmt/inputters/inputter.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 23 | 2020-04-22T06:06:56.000Z | 2022-01-23T22:32:27.000Z | onmt/inputters/inputter.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 6 | 2020-05-09T07:11:53.000Z | 2021-05-23T08:46:44.000Z | onmt/inputters/inputter.py | sedrickkeh/Hashtag_new | 993edd200e2e0050e06982df2fec30bffaae5577 | [
"MIT"
] | 2 | 2020-07-15T21:03:14.000Z | 2020-11-26T03:37:25.000Z | # -*- coding: utf-8 -*-
import glob
import os
import codecs
import math
from collections import Counter, defaultdict
from itertools import chain, cycle
import torch
import torchtext.data
from torchtext.data import Field, RawField
from torchtext.vocab import Vocab
from torchtext.data.utils import RandomShuffler
from ... | 37.981756 | 158 | 0.608286 |
80a7b378db97cefa9ebad38b55f86661f4848e6d | 1,501 | py | Python | chaosencryptor/scripts/plot_image_histogram.py | WiIIiamTang/logistic-map-encryption | b323c76a25cde1a7663887db35c0de393edfdfcc | [
"MIT"
] | null | null | null | chaosencryptor/scripts/plot_image_histogram.py | WiIIiamTang/logistic-map-encryption | b323c76a25cde1a7663887db35c0de393edfdfcc | [
"MIT"
] | null | null | null | chaosencryptor/scripts/plot_image_histogram.py | WiIIiamTang/logistic-map-encryption | b323c76a25cde1a7663887db35c0de393edfdfcc | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import argparse
from PIL import Image
def as_hex(red=0, green=0, blue=0):
return f'#{red:02X}{green:02X}{blue:02X}'
def plot_and_save(image, name=None):
hist_data = image.histogram()
hist_data = [hist_data[i:i+256] for i in range(0, le... | 34.906977 | 103 | 0.667555 |
3db6854f7a5ed8165d24c3332ae3434859b84667 | 1,007 | py | Python | Python 3 - Mundo 3/Desafios das Aulas - Mundo 3/Desafio113-FuncoesAprofundadasEmPython.py | Pedro0901/python3-curso-em-video | 2e8995a5352c1918e5da68e7868a613b938e9c29 | [
"MIT"
] | 1 | 2021-07-05T03:13:33.000Z | 2021-07-05T03:13:33.000Z | Python 3 - Mundo 3/Desafios das Aulas - Mundo 3/Desafio113-FuncoesAprofundadasEmPython.py | Pedro0901/python3-curso-em-video | 2e8995a5352c1918e5da68e7868a613b938e9c29 | [
"MIT"
] | null | null | null | Python 3 - Mundo 3/Desafios das Aulas - Mundo 3/Desafio113-FuncoesAprofundadasEmPython.py | Pedro0901/python3-curso-em-video | 2e8995a5352c1918e5da68e7868a613b938e9c29 | [
"MIT"
] | null | null | null | '''
Exercicio Python 113: Reescreva a função leiaInt() que
fizemos no desafio 104, incluindo agora a possibilidade
da digitação de um número de tipo inválido. Aproveite
e crie também uma função leiaFloat() com a mesma funcionalidade
'''
def leiaInt(msg):
while True:
try:
n = int(input(msg))
except (ValueError, ... | 26.5 | 63 | 0.717974 |
59bc7694cde78ddf1e31251f31995266748c7d41 | 660 | py | Python | python3/aoc-01-01/test_main.py | brunobell/aoc-2019 | 58cfcd21d5a6369a178127be7c7339aa0c2e19ee | [
"MIT"
] | null | null | null | python3/aoc-01-01/test_main.py | brunobell/aoc-2019 | 58cfcd21d5a6369a178127be7c7339aa0c2e19ee | [
"MIT"
] | null | null | null | python3/aoc-01-01/test_main.py | brunobell/aoc-2019 | 58cfcd21d5a6369a178127be7c7339aa0c2e19ee | [
"MIT"
] | null | null | null | import unittest
from main import Solution
class TestMain(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.solution = Solution()
def test_fuel_part_1(self):
self.assertEqual(self.solution.fuel_part_1(12), 2)
self.assertEqual(self.solution.fuel_part_1(14), 2)
self... | 30 | 66 | 0.709091 |
4144a6841918055fa061948b4baf124850303129 | 5,398 | py | Python | non_semantic_speech_benchmark/eval_embedding/metrics.py | suryatmodulus/google-research | 9699dd900a3e45eb4e67d1e6f8246e16aed42d1f | [
"Apache-2.0"
] | null | null | null | non_semantic_speech_benchmark/eval_embedding/metrics.py | suryatmodulus/google-research | 9699dd900a3e45eb4e67d1e6f8246e16aed42d1f | [
"Apache-2.0"
] | null | null | null | non_semantic_speech_benchmark/eval_embedding/metrics.py | suryatmodulus/google-research | 9699dd900a3e45eb4e67d1e6f8246e16aed42d1f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | 33.52795 | 80 | 0.697481 |
23ada6d60b9d20d7fd0c9bfc489a6b718a8f82bb | 28,009 | py | Python | examples/pytorch-distributed.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | examples/pytorch-distributed.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | examples/pytorch-distributed.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | """
PyTorch 1.0 Distributed Trainer with Amazon AWS
===============================================
"""
######################################################################
# **Nathan Inkawhich, Pieter Noordhuis & Teng Li**
#
# In this tutorial we will show how to setup, code, and run a PyTorch 1.0
# distributed tra... | 41.804478 | 156 | 0.685672 |
624a329749b913b689365519d5cbd92e7b28d1cd | 486 | py | Python | check_files/reify_source_sp.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | 32 | 2015-01-12T10:11:42.000Z | 2021-11-14T19:45:14.000Z | check_files/reify_source_sp.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | 42 | 2015-02-12T09:54:11.000Z | 2022-03-31T11:33:39.000Z | check_files/reify_source_sp.py | shantanusharma/bigmler | 3f9d76e8567de1aa7976a84b3e6130a2c83d4515 | [
"Apache-2.0"
] | 23 | 2015-03-04T13:25:23.000Z | 2020-07-15T18:25:52.000Z | from bigml.api import BigML
api = BigML()
source1_file = "iris_sp_chars.csv"
args = \
{'fields': {'000000': {'name': 'sépal.length', 'optype': 'numeric'},
'000001': {'name': 'sépal&width', 'optype': 'numeric'},
'000002': {'name': 'pétal.length', 'optype': 'numeric'},
'000003': {'name': 'pétal&width\x00', 'optype': 'num... | 34.714286 | 68 | 0.648148 |
f52378f8ce9930bb5daa6a3d4f64a09500dea39f | 373 | py | Python | source/offline_ds_evaluation/metrics_manager.py | kschweig/HopfieldOfflineRL | dcb1d475c2406cd0f64ed37d187d0b4f0890f02f | [
"MIT"
] | null | null | null | source/offline_ds_evaluation/metrics_manager.py | kschweig/HopfieldOfflineRL | dcb1d475c2406cd0f64ed37d187d0b4f0890f02f | [
"MIT"
] | null | null | null | source/offline_ds_evaluation/metrics_manager.py | kschweig/HopfieldOfflineRL | dcb1d475c2406cd0f64ed37d187d0b4f0890f02f | [
"MIT"
] | null | null | null | class MetricsManager:
def __init__(self, experiment):
self.experiment = experiment
self.data = dict()
def append(self, new_data: list()):
# environment and Buffer type as identifier
self.data["/".join(new_data[:2])] = new_data[2:]
def get_data(self, env, buffer_type):
... | 24.866667 | 56 | 0.621984 |
8c1369a4c4cd174d1f78a364f618b883fbae3d21 | 556 | py | Python | P5430.py | daily-boj/RanolP | 74294a4628e96a64def885fdcdd9c1444224802c | [
"Unlicense"
] | 13 | 2020-04-07T16:05:29.000Z | 2021-11-16T07:30:05.000Z | P5430.py | daily-boj/RanolP | 74294a4628e96a64def885fdcdd9c1444224802c | [
"Unlicense"
] | 2 | 2020-04-14T18:06:51.000Z | 2020-04-15T12:37:57.000Z | P5430.py | daily-boj/RanolP | 74294a4628e96a64def885fdcdd9c1444224802c | [
"Unlicense"
] | 7 | 2020-04-07T16:13:45.000Z | 2021-09-30T18:49:35.000Z | T = int(input())
for _ in range(T):
p = input()
input()
array = eval(input())
error = False
is_reversed = False
for c in p:
if c == "R":
is_reversed = not is_reversed
elif c == "D":
if len(array) == 0:
error = True
break
... | 24.173913 | 88 | 0.438849 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.