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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74729912517766e23a1dbfb0cd8ee36a32d87e3 | 2,084 | py | Python | main.py | tbaumer22/rpiAutoGarden | 4f35ddb6309939d169cbcd8eaa217220972fef3a | [
"MIT"
] | null | null | null | main.py | tbaumer22/rpiAutoGarden | 4f35ddb6309939d169cbcd8eaa217220972fef3a | [
"MIT"
] | null | null | null | main.py | tbaumer22/rpiAutoGarden | 4f35ddb6309939d169cbcd8eaa217220972fef3a | [
"MIT"
] | null | null | null | import os
import time
import datetime as dt
import schedule
from threading import Timer
from weather import Weather, Unit
weather = Weather(unit=Unit.CELSIUS)
lookup = weather.lookup(2487365)
condition = lookup.condition
needToWaterEarly = True
needToWaterMore = True
triggerConditions = ["tropical storm", "showers",... | 32.061538 | 128 | 0.679463 | import os
import time
import datetime as dt
import schedule
from threading import Timer
from weather import Weather, Unit
weather = Weather(unit=Unit.CELSIUS)
lookup = weather.lookup(2487365)
condition = lookup.condition
needToWaterEarly = True
needToWaterMore = True
triggerConditions = ["tropical storm", "showers",... | true | true |
f74729c8371779b2bf4988524e1efd6b300b0239 | 10,473 | py | Python | src/oci/database_tools/models/__init__.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2020-09-10T22:09:45.000Z | 2021-12-24T17:00:07.000Z | src/oci/database_tools/models/__init__.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database_tools/models/__init__.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 81.186047 | 245 | 0.905376 |
from __future__ import absolute_import
from .change_database_tools_connection_compartment_details import ChangeDatabaseToolsConnectionCompartmentDetails
from .change_database_tools_private_endpoint_compartment_details import ChangeDatabaseToolsPrivateEndpointCompartmentDetails
from .create_database_tools_connectio... | true | true |
f7472a7c0b7f43dc48a11e24267d88a8bfacbfe1 | 7,488 | py | Python | aw_nas/final/rnn_model.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 195 | 2020-08-15T17:39:23.000Z | 2022-02-28T07:48:03.000Z | aw_nas/final/rnn_model.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 22 | 2020-08-16T01:44:48.000Z | 2022-03-12T00:46:54.000Z | aw_nas/final/rnn_model.py | Harald-R/aw_nas | 8cf0cf48f7bcfd7893e6355dcc3ccbc83fd39783 | [
"MIT"
] | 27 | 2020-08-16T06:34:56.000Z | 2022-03-06T18:16:52.000Z | #pylint: disable=invalid-name
import numpy as np
import torch
from torch import nn
from aw_nas import ops
from aw_nas.utils.exception import expect, ConfigException
from aw_nas.weights_manager.rnn_shared import RNNSharedNet, INIT_RANGE
class RNNGenotypeModel(RNNSharedNet):
REGISTRY = "final_model"
NAME = "rn... | 40.918033 | 118 | 0.603232 |
import numpy as np
import torch
from torch import nn
from aw_nas import ops
from aw_nas.utils.exception import expect, ConfigException
from aw_nas.weights_manager.rnn_shared import RNNSharedNet, INIT_RANGE
class RNNGenotypeModel(RNNSharedNet):
REGISTRY = "final_model"
NAME = "rnn_model"
def __init__(sel... | true | true |
f7472ab34c5ca0f3f69adf1962d60ecf58aecec6 | 3,094 | py | Python | gym_stag_hunt/envs/abstract_markov_staghunt.py | DavidRother/Gym-Stag-Hunt | 2ffc378d58c833b811dabe34c09b8dd864c83e71 | [
"MIT"
] | 1 | 2021-06-02T04:10:08.000Z | 2021-06-02T04:10:08.000Z | gym_stag_hunt/envs/abstract_markov_staghunt.py | DavidRother/Gym-Stag-Hunt | 2ffc378d58c833b811dabe34c09b8dd864c83e71 | [
"MIT"
] | null | null | null | gym_stag_hunt/envs/abstract_markov_staghunt.py | DavidRother/Gym-Stag-Hunt | 2ffc378d58c833b811dabe34c09b8dd864c83e71 | [
"MIT"
] | null | null | null | from abc import ABC
from gym import Env
from gym_stag_hunt.src.utils import print_matrix
class AbstractMarkovStagHuntEnv(Env, ABC):
metadata = {
'render.modes': ['human', 'array'],
'obs.types': ['image', 'coords']
}
def __init__(self,
grid_size=(5, 5),
... | 36.4 | 120 | 0.585973 | from abc import ABC
from gym import Env
from gym_stag_hunt.src.utils import print_matrix
class AbstractMarkovStagHuntEnv(Env, ABC):
metadata = {
'render.modes': ['human', 'array'],
'obs.types': ['image', 'coords']
}
def __init__(self,
grid_size=(5, 5),
... | true | true |
f7472b505b51547dca573b4ee0effd9df1a06a05 | 1,019 | py | Python | btsapi/modules/authentication/controllers.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 2 | 2018-04-25T01:12:06.000Z | 2018-06-27T22:08:08.000Z | btsapi/modules/authentication/controllers.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 1 | 2019-03-03T09:15:29.000Z | 2019-03-03T09:19:03.000Z | btsapi/modules/authentication/controllers.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 4 | 2018-03-10T23:30:00.000Z | 2019-12-10T06:21:52.000Z | from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, \
jsonify, make_response
from btsapi.modules.users.models import User, UserSchema
from btsapi.extensions import db
import datetime
import base64
# @TODO: Change this endpoint to /api/authe... | 31.84375 | 89 | 0.672228 | from flask import Blueprint, request, render_template, \
flash, g, session, redirect, url_for, \
jsonify, make_response
from btsapi.modules.users.models import User, UserSchema
from btsapi.extensions import db
import datetime
import base64
mod_auth = Blueprint('authetication', __na... | true | true |
f7472b67caaccda28cf0edd2bff43417639ea849 | 4,783 | py | Python | facebook_business/test/async_ad_docs.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | facebook_business/test/async_ad_docs.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | facebook_business/test/async_ad_docs.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | 1 | 2018-09-24T14:04:48.000Z | 2018-09-24T14:04:48.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 36.51145 | 76 | 0.701861 |
import sys
from facebook_business.asyncapi import FacebookAdsAsyncApi
from facebook_business.objects import Insights
from facebook_business.test.async_docs_utils import *
from facebook_business.utils.httpretries import retry_policy
class AdDocsTestCase(AsyncDocsTestCase):
def setUp(self):
... | true | true |
f7472d791f380b8bca0715ab4a4f811a3fff949b | 15,246 | py | Python | script/hassfest/mypy_config.py | kdanthony/core | bf2d40adfed9b9689bcbb61b18306fa1098f74eb | [
"Apache-2.0"
] | null | null | null | script/hassfest/mypy_config.py | kdanthony/core | bf2d40adfed9b9689bcbb61b18306fa1098f74eb | [
"Apache-2.0"
] | 70 | 2020-08-05T07:20:00.000Z | 2022-03-31T06:01:46.000Z | script/hassfest/mypy_config.py | kdanthony/core | bf2d40adfed9b9689bcbb61b18306fa1098f74eb | [
"Apache-2.0"
] | null | null | null | """Generate mypy config."""
from __future__ import annotations
import configparser
import io
import os
from pathlib import Path
from typing import Final
from .model import Config, Integration
# Modules which have type hints which known to be broken.
# If you are an author of component listed here, please fix these e... | 39.092308 | 84 | 0.699659 | from __future__ import annotations
import configparser
import io
import os
from pathlib import Path
from typing import Final
from .model import Config, Integration
IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.adguard.*",
"homeassistant.components.aemet.*",
"homeassistant.components... | true | true |
f7472dcd6d23281c3c9432fc53d94a319cb5d280 | 857 | py | Python | make_fingerprint.py | BenWiederhake/random_tweets | ba67cd0973ae7038d5eab23c8b866d9066a29033 | [
"MIT"
] | null | null | null | make_fingerprint.py | BenWiederhake/random_tweets | ba67cd0973ae7038d5eab23c8b866d9066a29033 | [
"MIT"
] | null | null | null | make_fingerprint.py | BenWiederhake/random_tweets | ba67cd0973ae7038d5eab23c8b866d9066a29033 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import codecs
import hashlib
import random_tweets
import requests
import sys
def make_fingerprint(url):
host = requests.urllib3.util.url.parse_url(url).host
if host is None:
host = '-INVALID-'
fingerprint = hashlib.md5(host.encode('utf-8')).hexdigest()
comment = codecs.... | 25.205882 | 96 | 0.606768 |
import codecs
import hashlib
import random_tweets
import requests
import sys
def make_fingerprint(url):
host = requests.urllib3.util.url.parse_url(url).host
if host is None:
host = '-INVALID-'
fingerprint = hashlib.md5(host.encode('utf-8')).hexdigest()
comment = codecs.getencoder('base64')(h... | true | true |
f7472ea3c285235f42a541468706ef045ddba91d | 1,038 | py | Python | app/__init__.py | OjureFred/NoblePitch | cf160d508ca0b79d36a08856598563517831008d | [
"MIT"
] | null | null | null | app/__init__.py | OjureFred/NoblePitch | cf160d508ca0b79d36a08856598563517831008d | [
"MIT"
] | null | null | null | app/__init__.py | OjureFred/NoblePitch | cf160d508ca0b79d36a08856598563517831008d | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_mail import Mail
from flask_simplemde import SimpleMDE
from config import config_options
bootstrap = Bootstrap()
db = SQLAlchemy()
mail = Mail()
simple = SimpleMDE()
log... | 25.317073 | 72 | 0.76975 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_mail import Mail
from flask_simplemde import SimpleMDE
from config import config_options
bootstrap = Bootstrap()
db = SQLAlchemy()
mail = Mail()
simple = SimpleMDE()
log... | true | true |
f74730279b8d5dd20cda1f0da248b5120ad98509 | 12,606 | py | Python | detectron/utils/net.py | stephan-who/Detectron | 72742be6197d0f610fe53e89c92c486926966974 | [
"Apache-2.0"
] | null | null | null | detectron/utils/net.py | stephan-who/Detectron | 72742be6197d0f610fe53e89c92c486926966974 | [
"Apache-2.0"
] | null | null | null | detectron/utils/net.py | stephan-who/Detectron | 72742be6197d0f610fe53e89c92c486926966974 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-present, Facebook, 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... | 42.160535 | 86 | 0.617166 |
if has_momentum:
workspace.FeedBlob(
dst_name + '_momentum',
src_blobs[src_name + '_momentum'].astype(
np.float32, copy=False))
for src_name in src_blobs.keys():
if (src_name not... | true | true |
f747304d6eb21e2e5723c3fa4b8dd5da8108401d | 7,175 | py | Python | qhana/backend/elementComparer.py | UST-QuAntiL/qhana | bf499d072dcc37f81efec1b8e17b7d5460db7a04 | [
"Apache-2.0"
] | 1 | 2021-03-12T14:06:43.000Z | 2021-03-12T14:06:43.000Z | qhana/backend/elementComparer.py | UST-QuAntiL/qhana | bf499d072dcc37f81efec1b8e17b7d5460db7a04 | [
"Apache-2.0"
] | null | null | null | qhana/backend/elementComparer.py | UST-QuAntiL/qhana | bf499d072dcc37f81efec1b8e17b7d5460db7a04 | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta
from abc import abstractmethod
from typing import Any
import enum
import networkx as nx
from networkx import Graph
from qhana.backend.taxonomie import Taxonomie
from qhana.backend.logger import Logger
import numpy as np
from qhana.backend.logger import Logger
import os
import json
import math
fr... | 32.466063 | 117 | 0.612683 | from abc import ABCMeta
from abc import abstractmethod
from typing import Any
import enum
import networkx as nx
from networkx import Graph
from qhana.backend.taxonomie import Taxonomie
from qhana.backend.logger import Logger
import numpy as np
from qhana.backend.logger import Logger
import os
import json
import math
fr... | true | true |
f747305a11aa8965636cfeaaed96922c6a9b2aae | 637 | py | Python | opencv_learn/charpter12/demo_12.06.py | zhangxinzhou/play_game | 854448f8416b2d3f98bb2c3ed0f7d834a61593de | [
"Apache-2.0"
] | null | null | null | opencv_learn/charpter12/demo_12.06.py | zhangxinzhou/play_game | 854448f8416b2d3f98bb2c3ed0f7d834a61593de | [
"Apache-2.0"
] | null | null | null | opencv_learn/charpter12/demo_12.06.py | zhangxinzhou/play_game | 854448f8416b2d3f98bb2c3ed0f7d834a61593de | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
o = cv2.imread("contours.bmp")
gray = cv2.cvtColor(o, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
contours, hierarchy = cv2.findContours(binary, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
cv2.imshow("original", o)
n = len(contours)
contoursImg = []
for ... | 31.85 | 86 | 0.700157 | import cv2
import numpy as np
o = cv2.imread("contours.bmp")
gray = cv2.cvtColor(o, cv2.COLOR_BGR2GRAY)
ret, binary = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
contours, hierarchy = cv2.findContours(binary, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
cv2.imshow("original", o)
n = len(contours)
contoursImg = []
for ... | true | true |
f747308714b176abe38df4e4001e5c2e31ec0713 | 4,181 | py | Python | gym_learning_to_learn/envs/base_env.py | bstriner/gym-learning-to-learn | 4cd93bf7a306255771a32e0d97b3d705b2666656 | [
"MIT"
] | 1 | 2021-06-14T15:37:32.000Z | 2021-06-14T15:37:32.000Z | gym_learning_to_learn/envs/base_env.py | bstriner/gym-learning-to-learn | 4cd93bf7a306255771a32e0d97b3d705b2666656 | [
"MIT"
] | null | null | null | gym_learning_to_learn/envs/base_env.py | bstriner/gym-learning-to-learn | 4cd93bf7a306255771a32e0d97b3d705b2666656 | [
"MIT"
] | 1 | 2017-01-27T05:49:59.000Z | 2017-01-27T05:49:59.000Z | from gym import Env
from gym.utils import seeding
from gym import spaces
import numpy as np
import keras.backend as K
class BaseEnv(Env):
metadata = {'render.modes': ['human', 'ansi']}
def __init__(self, action_mapping):
self._seed()
self.verbose = 0
self.viewer = None
self.ba... | 36.043103 | 113 | 0.567807 | from gym import Env
from gym.utils import seeding
from gym import spaces
import numpy as np
import keras.backend as K
class BaseEnv(Env):
metadata = {'render.modes': ['human', 'ansi']}
def __init__(self, action_mapping):
self._seed()
self.verbose = 0
self.viewer = None
self.ba... | true | true |
f74730970ebec6431805c2f723cede34fa4d02ff | 15,624 | py | Python | venv/Lib/site-packages/pymodbus/payload.py | amalieKo/Balancing-Platform | a8382e51b70480404cb9ec2988e61bc65b9e86c6 | [
"MIT"
] | 6 | 2019-01-15T19:50:43.000Z | 2021-12-06T03:52:18.000Z | venv/Lib/site-packages/pymodbus/payload.py | amalieKo/Balancing-Platform | a8382e51b70480404cb9ec2988e61bc65b9e86c6 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pymodbus/payload.py | amalieKo/Balancing-Platform | a8382e51b70480404cb9ec2988e61bc65b9e86c6 | [
"MIT"
] | 6 | 2018-11-08T13:38:53.000Z | 2021-05-28T14:29:14.000Z | """
Modbus Payload Builders
------------------------
A collection of utilities for building and decoding
modbus messages payloads.
"""
from struct import pack, unpack
from pymodbus.interfaces import IPayloadBuilder
from pymodbus.constants import Endian
from pymodbus.utilities import pack_bitstring
from pymodbus.util... | 33.031712 | 82 | 0.588006 | from struct import pack, unpack
from pymodbus.interfaces import IPayloadBuilder
from pymodbus.constants import Endian
from pymodbus.utilities import pack_bitstring
from pymodbus.utilities import unpack_bitstring
from pymodbus.utilities import make_byte_string
from pymodbus.exceptions import ParameterException
from pymo... | true | true |
f747310db40efaff595775bdbf6ab22beac0f310 | 237 | py | Python | python/2.OOP/1Encapsulation/1.3.__str__.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 25 | 2018-06-13T08:13:44.000Z | 2020-11-19T14:02:11.000Z | python/2.OOP/1Encapsulation/1.3.__str__.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | null | null | null | python/2.OOP/1Encapsulation/1.3.__str__.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 13 | 2018-06-13T08:13:38.000Z | 2022-01-06T06:45:07.000Z | class Student(object):
def __init__(self, name, age):
self.name = name
self.age = age
# self别忘记写了
def __str__(self):
return "姓名:%s,年龄:%s" % (self.name, self.age)
lisi = Student("李四", 22)
print(lisi) | 19.75 | 52 | 0.57384 | class Student(object):
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "姓名:%s,年龄:%s" % (self.name, self.age)
lisi = Student("李四", 22)
print(lisi) | true | true |
f7473119c94e365fee46f952464de324b16f929c | 6,905 | py | Python | resources/mls_handler.py | markmelnic/CellTower-Radar | 801973498a8de4aa942a237d90b0fd09db5e3bb0 | [
"MIT"
] | 2 | 2021-02-03T09:42:45.000Z | 2021-12-20T05:31:48.000Z | resources/mls_handler.py | markmelnic/CellTower-Radar | 801973498a8de4aa942a237d90b0fd09db5e3bb0 | [
"MIT"
] | null | null | null | resources/mls_handler.py | markmelnic/CellTower-Radar | 801973498a8de4aa942a237d90b0fd09db5e3bb0 | [
"MIT"
] | 3 | 2020-10-06T01:36:00.000Z | 2021-12-08T17:43:03.000Z |
import os, csv, json, shutil, requests, gzip
import pandas as pd
from bs4 import BeautifulSoup
from scipy import spatial
from geopy.distance import great_circle
from resources.utils import cartesian
from resources.scrape_mccs import scrape_mccs, MCCS_JSON
HEADERS = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64... | 38.361111 | 143 | 0.555539 |
import os, csv, json, shutil, requests, gzip
import pandas as pd
from bs4 import BeautifulSoup
from scipy import spatial
from geopy.distance import great_circle
from resources.utils import cartesian
from resources.scrape_mccs import scrape_mccs, MCCS_JSON
HEADERS = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64... | true | true |
f74731256d0f2d68a38247eb8de514eee59345a7 | 2,887 | py | Python | LSAPlugin.py | movingpictures83/LSA | d28c4be1bbd2d908cf8b414d816680c3bf65f050 | [
"MIT"
] | null | null | null | LSAPlugin.py | movingpictures83/LSA | d28c4be1bbd2d908cf8b414d816680c3bf65f050 | [
"MIT"
] | null | null | null | LSAPlugin.py | movingpictures83/LSA | d28c4be1bbd2d908cf8b414d816680c3bf65f050 | [
"MIT"
] | null | null | null | import sys
import numpy
import random
class LSAPlugin:
def input(self, filename):
self.myfile = filename
def run(self):
filestuff = open(self.myfile, 'r')
self.firstline = filestuff.readline()
lines = []
for line in filestuff:
lines.append(line)
self.m = len(lines)... | 29.459184 | 91 | 0.456183 | import sys
import numpy
import random
class LSAPlugin:
def input(self, filename):
self.myfile = filename
def run(self):
filestuff = open(self.myfile, 'r')
self.firstline = filestuff.readline()
lines = []
for line in filestuff:
lines.append(line)
self.m = len(lines)... | true | true |
f74732f52e7b1c7648a2f3e5aaba63cc5308de8d | 954 | py | Python | app/main.py | cryptobellum/ds-bw | ab258b37ae99d78767631c010f6f9e1f615dfffa | [
"MIT"
] | 7 | 2020-07-17T21:18:17.000Z | 2021-06-29T04:52:59.000Z | app/main.py | cryptobellum/ds-bw | ab258b37ae99d78767631c010f6f9e1f615dfffa | [
"MIT"
] | 2 | 2020-08-03T14:54:04.000Z | 2020-08-28T03:30:27.000Z | app/main.py | cryptobellum/ds-bw | ab258b37ae99d78767631c010f6f9e1f615dfffa | [
"MIT"
] | 53 | 2020-06-16T16:21:59.000Z | 2021-06-26T02:08:39.000Z | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app import db, ml, viz
description = """
Edit your app's title and description. See [https://fastapi.tiangolo.com/tutorial/metadata/](https://fastapi.tiangolo.com/tutorial/metadata/)
To use these interactive docs:
- Cl... | 25.105263 | 141 | 0.720126 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app import db, ml, viz
description = """
Edit your app's title and description. See [https://fastapi.tiangolo.com/tutorial/metadata/](https://fastapi.tiangolo.com/tutorial/metadata/)
To use these interactive docs:
- Cl... | true | true |
f747331dcd666e654f47dbc3d679b85925957eaa | 3,195 | py | Python | segmentron/models/danet.py | cocolord/SegmenTron | bb9415c22b1f6e0a032a71112e5a5a03e5ec6eab | [
"Apache-2.0"
] | 654 | 2019-11-16T16:12:06.000Z | 2022-03-31T16:55:34.000Z | segmentron/models/danet.py | nemonameless/SegmenTron | 940015dc35614c15bd303f91f611878efbab8796 | [
"Apache-2.0"
] | 66 | 2019-11-25T02:15:33.000Z | 2021-11-15T02:54:49.000Z | segmentron/models/danet.py | nemonameless/SegmenTron | 940015dc35614c15bd303f91f611878efbab8796 | [
"Apache-2.0"
] | 145 | 2019-11-16T16:12:10.000Z | 2022-03-31T07:21:09.000Z | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .segbase import SegBaseModel
from .model_zoo import MODEL_REGISTRY
from ..modules import _FCNHead, PAM_Module, CAM_Module
__all__ = ['DANet']
@MODEL_REGISTRY.register()
class DANet(SegBaseModel):
r"""DANet m... | 35.5 | 104 | 0.593114 | from __future__ import division
import torch
import torch.nn as nn
import torch.nn.functional as F
from .segbase import SegBaseModel
from .model_zoo import MODEL_REGISTRY
from ..modules import _FCNHead, PAM_Module, CAM_Module
__all__ = ['DANet']
@MODEL_REGISTRY.register()
class DANet(SegBaseModel):
def __init_... | true | true |
f7473326ff2c4f630008242eafe7629b1b3c35b4 | 2,512 | py | Python | automatedDataExtraction/dynamicAnalysisPrototype/fileAccessObservations.py | malus-security/ioracle | d68c005bb1325d87c3267a7ebebd1b895f3390be | [
"BSD-3-Clause"
] | 1 | 2020-08-17T08:06:07.000Z | 2020-08-17T08:06:07.000Z | automatedDataExtraction/dynamicAnalysisPrototype/fileAccessObservations.py | malus-security/ioracle | d68c005bb1325d87c3267a7ebebd1b895f3390be | [
"BSD-3-Clause"
] | null | null | null | automatedDataExtraction/dynamicAnalysisPrototype/fileAccessObservations.py | malus-security/ioracle | d68c005bb1325d87c3267a7ebebd1b895f3390be | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#Note to self: I am assuming that extensions without a class type are generics and labelling them that way in the facts.
#we will need to modify this if I'm wrong about how to handle this type of extension.
#when there is more time, we should look into these by figuring out who issues them and an... | 41.180328 | 124 | 0.709395 |
#when there is more time, we should look into these by figuring out who issues them and analyzing the issuers with IDA.
#for now, we don't really care though since the only extensions we're worried about are file type and mach type.
import sys
import re
fileAccessPath = sys.argv[1]
processesInfoPath = sys.argv[2]... | true | true |
f7473375efdd1601a2d88ef7585ad76adeb74718 | 322 | py | Python | ProgramacaoOO/Loja/pessoa.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | ProgramacaoOO/Loja/pessoa.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | 4 | 2021-04-08T21:54:09.000Z | 2022-02-10T14:35:13.000Z | ProgramacaoOO/Loja/pessoa.py | VictorMello1993/CursoPythonUdemy | d3e2e542a7c3d3f9635f2b88d0e75ab4fa84236d | [
"MIT"
] | null | null | null | MAIOR_IDADE = 18
class Pessoa:
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
def __str__(self):
if not self.idade:
return self.nome
return f'{self.nome} - {self.idade}'
def is_adult(self):
return (self.idade or 0) >= MAIOR_IDAD... | 17.888889 | 47 | 0.571429 | MAIOR_IDADE = 18
class Pessoa:
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
def __str__(self):
if not self.idade:
return self.nome
return f'{self.nome} - {self.idade}'
def is_adult(self):
return (self.idade or 0) >= MAIOR_IDAD... | true | true |
f74734436deb6a4b07c419fc84c6752388928560 | 14,947 | py | Python | extensions/rich_text_components/components_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 2 | 2022-03-27T23:15:17.000Z | 2022-03-27T23:15:32.000Z | extensions/rich_text_components/components_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | null | null | null | extensions/rich_text_components/components_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 2 | 2022-03-22T16:57:32.000Z | 2022-03-24T17:38:42.000Z | # coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.334211 | 118 | 0.529404 |
from __future__ import annotations
import inspect
import os
import re
from core import utils
from core.tests import test_utils
from extensions.rich_text_components import components
class ComponentValidationUnitTests(test_utils.GenericTestBase):
def check_validation(
self, rte_comp... | true | true |
f747350ed2fe7ea42b0ccce6f38156b781455d8b | 1,003 | py | Python | taxamo/models/emailInvoiceIn.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 4 | 2016-03-14T03:59:08.000Z | 2020-06-21T07:58:38.000Z | taxamo/models/emailInvoiceIn.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 2 | 2016-03-07T13:41:23.000Z | 2017-07-11T13:39:44.000Z | taxamo/models/emailInvoiceIn.py | taxamo/taxamo-python | 190bdda68963860c131d2b1e9d31cd88de10d694 | [
"Apache-2.0"
] | 8 | 2016-01-13T14:32:19.000Z | 2021-08-16T11:14:06.000Z | #!/usr/bin/env python
"""
Copyright 2014-2021 by Taxamo
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 applic... | 31.34375 | 90 | 0.690927 |
class EmailInvoiceIn:
def __init__(self):
self.swaggerTypes = {
'buyer_email': 'str'
}
self.buyer_email = None
| true | true |
f7473544b1822a3a0d70bbc5fd6b0a198a10e969 | 90,128 | py | Python | test/functional/p2p_segwit.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | test/functional/p2p_segwit.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | test/functional/p2p_segwit.py | thehomosapien/AMLBitcoin | f097ca52c2e8039761f1927d83a9fe0b4c355b1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The AmlBitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network.... | 46.195797 | 143 | 0.658253 |
from test_framework.mininode import *
from test_framework.test_framework import AmlBitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER
f... | true | true |
f747357f209b9cc7c44b42ce07202298e507cedd | 2,896 | py | Python | structy-practice-solutions/99-blackJack.py | RuthraVed/hackerearth-practice-solutions | 663f46226a53c20979b8249e96b733b86d09ff8a | [
"MIT"
] | null | null | null | structy-practice-solutions/99-blackJack.py | RuthraVed/hackerearth-practice-solutions | 663f46226a53c20979b8249e96b733b86d09ff8a | [
"MIT"
] | null | null | null | structy-practice-solutions/99-blackJack.py | RuthraVed/hackerearth-practice-solutions | 663f46226a53c20979b8249e96b733b86d09ff8a | [
"MIT"
] | null | null | null | '''
BLACKJACK HIGHEST
Basic Blackjack rules:
1. Cards with the numbers 2 through 10 have their face value.
2. Jacks, queens, and kings are valued at 10 points.
3. Aces can be 1 or 11 points.
Have the function BlackjackHighest(strArr) take the strArr parameter being passed
which will be an array of numbers and letter... | 39.135135 | 201 | 0.711671 |
def BlackjackHighest(strArr):
cards_list = ['ace','two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'jack', 'queen', 'king']
cards_values = [11,2,3,4,5,6,7,8,9,10,10,10,10]
hand_values = []
highest_card_rank = 0
ace_in_deck = False
for card in strArr:
index_of_card = cards_list.i... | true | true |
f74735bd66f1a0261ec32cc6cb85f99786bfa4c2 | 19,702 | py | Python | unyt/tests/test_units.py | thisch/unyt | 27894c1edc275205a9ad2e0d9f47d11241e1f5c3 | [
"BSD-3-Clause"
] | null | null | null | unyt/tests/test_units.py | thisch/unyt | 27894c1edc275205a9ad2e0d9f47d11241e1f5c3 | [
"BSD-3-Clause"
] | null | null | null | unyt/tests/test_units.py | thisch/unyt | 27894c1edc275205a9ad2e0d9f47d11241e1f5c3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Test symbolic unit handling.
"""
# -----------------------------------------------------------------------------
# Copyright (c) 2018, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this sof... | 25.45478 | 88 | 0.627652 |
import numpy as np
from numpy.testing import (
assert_almost_equal,
assert_allclose,
assert_array_almost_equal_nulp,
assert_equal,
)
import operator
import pickle
import pytest
from sympy import Symbol
from unyt.testing import assert_allclose_units
from unyt.unit_registry import UnitRegistry... | true | true |
f74736102e67af2429373697343787ec8b0c3da4 | 440 | py | Python | code/01-intro-asyncio/sync_demo.py | mfonism/us-pycon-2019-tutorial | bdf98b471acd9d9111c633ea6a0b9516539ed8d9 | [
"Apache-2.0"
] | 56 | 2019-04-18T11:11:15.000Z | 2022-03-28T16:45:12.000Z | code/01-intro-asyncio/sync_demo.py | fcdk1982/us-pycon-2019-tutorial | bdf98b471acd9d9111c633ea6a0b9516539ed8d9 | [
"Apache-2.0"
] | 11 | 2019-04-18T18:51:06.000Z | 2019-05-02T23:44:48.000Z | code/01-intro-asyncio/sync_demo.py | fcdk1982/us-pycon-2019-tutorial | bdf98b471acd9d9111c633ea6a0b9516539ed8d9 | [
"Apache-2.0"
] | 15 | 2019-05-02T17:17:43.000Z | 2021-05-18T02:53:26.000Z | import time
def long_running_task(time_to_sleep: int) -> None:
print(f"Begin sleep for {time_to_sleep}")
time.sleep(time_to_sleep)
print(f"Awake from {time_to_sleep}")
def main() -> None:
long_running_task(2)
long_running_task(10)
long_running_task(5)
if __name__ == "__main__":
s = tim... | 20.952381 | 53 | 0.675 | import time
def long_running_task(time_to_sleep: int) -> None:
print(f"Begin sleep for {time_to_sleep}")
time.sleep(time_to_sleep)
print(f"Awake from {time_to_sleep}")
def main() -> None:
long_running_task(2)
long_running_task(10)
long_running_task(5)
if __name__ == "__main__":
s = tim... | true | true |
f7473613deb0766b99315c742b58237acf9fe7aa | 3,944 | py | Python | tests/test_PolyViz.py | kobejohn/polymaze | c7ac6049bef547f032c353c5c50e8ead95954a33 | [
"MIT"
] | 21 | 2015-02-09T17:36:36.000Z | 2021-06-01T19:58:59.000Z | tests/test_PolyViz.py | kobejohn/polymaze | c7ac6049bef547f032c353c5c50e8ead95954a33 | [
"MIT"
] | 1 | 2017-01-12T13:52:07.000Z | 2017-01-12T13:52:07.000Z | tests/test_PolyViz.py | kobejohn/polymaze | c7ac6049bef547f032c353c5c50e8ead95954a33 | [
"MIT"
] | 4 | 2017-12-07T15:18:19.000Z | 2021-06-01T19:59:20.000Z | import unittest
from tests.test_PolyGrid import generic_grid
from polymaze.polygrid import PolyGrid, PolyViz
# silly workaround to allow tests to work in py2 or py3
try:
_assertCountEqual = unittest.TestCase.assertCountEqual # py3
from unittest import mock
except (AttributeError, ImportError):
_assertCou... | 39.838384 | 78 | 0.672667 | import unittest
from tests.test_PolyGrid import generic_grid
from polymaze.polygrid import PolyGrid, PolyViz
try:
_assertCountEqual = unittest.TestCase.assertCountEqual
from unittest import mock
except (AttributeError, ImportError):
_assertCountEqual = unittest.TestCase.assertItemsEqual
import mo... | true | true |
f7473704d0666a1a2ef0697dc0e706ddb1e68242 | 1,543 | py | Python | notes/algo-ds-practice/problems/divide_conquer/largest_rectangle_in_histogram.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/divide_conquer/largest_rectangle_in_histogram.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/divide_conquer/largest_rectangle_in_histogram.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | '''
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars.
For simplicity, assume that all bars have same width and the width is 1 unit.
For example, consider the following histogram with 7 bars of heights {6, 2, 5, 4, 5, 2, 6}.
The large... | 53.206897 | 188 | 0.777706 | true | true | |
f74737491bb1036b473979bbb4c7579f4a19d8b1 | 4,286 | py | Python | sdk/python/pulumi_azure_native/securityinsights/v20190101preview/get_threat_intelligence_indicator.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20190101preview/get_threat_intelligence_indicator.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/securityinsights/v20190101preview/get_threat_intelligence_indicator.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 34.564516 | 185 | 0.640924 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetThreatIntelligenceIndicatorResult',
'AwaitableGetThreatIntelligenceIndicatorResult',
'get_threat_intelligence_indicator',
]
@pulumi.output_... | true | true |
f74739276decc49faceb2f87efb08f043a224327 | 367 | py | Python | awwards/migrations/0005_auto_20201025_2322.py | Akumucollins/-Awwards | 5b40c92f6d948e6bfcd5b7e42eacce94ca158eb2 | [
"MIT"
] | null | null | null | awwards/migrations/0005_auto_20201025_2322.py | Akumucollins/-Awwards | 5b40c92f6d948e6bfcd5b7e42eacce94ca158eb2 | [
"MIT"
] | null | null | null | awwards/migrations/0005_auto_20201025_2322.py | Akumucollins/-Awwards | 5b40c92f6d948e6bfcd5b7e42eacce94ca158eb2 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-25 20:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('awwards', '0004_auto_20201025_2307'),
]
operations = [
migrations.RenameField(
model_name='project',
old_name='comment',
... | 19.315789 | 47 | 0.588556 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('awwards', '0004_auto_20201025_2307'),
]
operations = [
migrations.RenameField(
model_name='project',
old_name='comment',
new_name='comments',
),
]
| true | true |
f7473958e328aa01b9043eaaea2fe3657ac89c38 | 759 | py | Python | ProjectApplication/evaluation/migrations/0020_adds_proposals_person_to_reviewer.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 5 | 2020-07-29T10:00:11.000Z | 2022-02-19T11:00:34.000Z | ProjectApplication/evaluation/migrations/0020_adds_proposals_person_to_reviewer.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 471 | 2019-09-20T14:37:28.000Z | 2022-03-25T14:16:34.000Z | ProjectApplication/evaluation/migrations/0020_adds_proposals_person_to_reviewer.py | code-review-doctor/project-application | d85b40b69572efbcda24ce9c40803f76d8ffd192 | [
"MIT"
] | 5 | 2020-03-15T12:42:47.000Z | 2022-02-15T18:06:52.000Z | # Generated by Django 3.0.3 on 2020-03-20 11:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0111_remove_project_duration_months'),
('evaluation', '0019_historicalcallevaluation'),
]
o... | 29.192308 | 129 | 0.641634 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project_core', '0111_remove_project_duration_months'),
('evaluation', '0019_historicalcallevaluation'),
]
operations = [
migrations.AddField(
... | true | true |
f7473a103d567677307fc012622a03ca2e17096a | 14,837 | py | Python | tests/test_kernel_language.py | pierrick-giffard/parcels | 2447d4785b915e17f59f6c1f90703a35d2235c91 | [
"MIT"
] | null | null | null | tests/test_kernel_language.py | pierrick-giffard/parcels | 2447d4785b915e17f59f6c1f90703a35d2235c91 | [
"MIT"
] | null | null | null | tests/test_kernel_language.py | pierrick-giffard/parcels | 2447d4785b915e17f59f6c1f90703a35d2235c91 | [
"MIT"
] | null | null | null | from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Kernel, Variable, ErrorCode
from parcels.kernels.seawaterdensity import polyTEOS10_bsq, UNESCO_Density
from parcels import random as parcels_random
import numpy as np
import pytest
import random as py_random
from os import path
import sys
ptype = ... | 36.816377 | 129 | 0.599245 | from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Kernel, Variable, ErrorCode
from parcels.kernels.seawaterdensity import polyTEOS10_bsq, UNESCO_Density
from parcels import random as parcels_random
import numpy as np
import pytest
import random as py_random
from os import path
import sys
ptype = ... | true | true |
f7473a899ea8fc8e78ad452175b177ad0c3a03bc | 414 | py | Python | Hackerearth Set/EasyMultiple.py | Siddharth2016/PYTHON3_prog | 9dfa258d87f5b00779d39d9de9a49c1c6cea06be | [
"MIT"
] | 2 | 2019-02-26T14:06:53.000Z | 2019-02-27T17:13:01.000Z | Hackerearth Set/EasyMultiple.py | Siddharth2016/PYTHON3_prog | 9dfa258d87f5b00779d39d9de9a49c1c6cea06be | [
"MIT"
] | null | null | null | Hackerearth Set/EasyMultiple.py | Siddharth2016/PYTHON3_prog | 9dfa258d87f5b00779d39d9de9a49c1c6cea06be | [
"MIT"
] | 2 | 2017-12-26T07:59:57.000Z | 2018-06-24T03:35:05.000Z | # EASY MULTIPLE
for _ in range(int(input())):
n = int(input())-1
if n<3:
print('0')
continue
elif n<5:
print('3')
continue
t3 = n//3
t5 = n//5
t15 = n//15
t3l = t3*3
t5l = t5*5
t15l = t15*15
res3 = (t3*(3+t3l))//2
res5 = (t5*(... | 18.818182 | 32 | 0.434783 |
for _ in range(int(input())):
n = int(input())-1
if n<3:
print('0')
continue
elif n<5:
print('3')
continue
t3 = n//3
t5 = n//5
t15 = n//15
t3l = t3*3
t5l = t5*5
t15l = t15*15
res3 = (t3*(3+t3l))//2
res5 = (t5*(5+t5l))//2
... | true | true |
f7473aab82457b61ad5a1a6c123f2785f5c13821 | 2,700 | py | Python | gmplot/drawables/symbols/circle.py | tirkarthi/gmplot | 0979c51467e25cfe870668d3990ce7885e317f85 | [
"MIT"
] | null | null | null | gmplot/drawables/symbols/circle.py | tirkarthi/gmplot | 0979c51467e25cfe870668d3990ce7885e317f85 | [
"MIT"
] | null | null | null | gmplot/drawables/symbols/circle.py | tirkarthi/gmplot | 0979c51467e25cfe870668d3990ce7885e317f85 | [
"MIT"
] | null | null | null | from gmplot.color import _get_hex_color
from gmplot.utility import _get_value, _format_LatLng
class _Circle(object):
def __init__(self, lat, lng, radius, **kwargs):
'''
Args:
lat (float): Latitude of the center of the circle.
lng (float): Longitude of the center of the circl... | 42.857143 | 110 | 0.564444 | from gmplot.color import _get_hex_color
from gmplot.utility import _get_value, _format_LatLng
class _Circle(object):
def __init__(self, lat, lng, radius, **kwargs):
precision = _get_value(kwargs, ['precision'], 6)
self._center = _format_LatLng(lat, lng, precision)
self._radius = radius
... | true | true |
f7473aba082c9daaf7a230c843b739f19994172f | 1,399 | py | Python | problems/LongestCommonPrefix.py | strambake/data-structures-and-algorithms | 739ded4b9b2feaf0da5a7383558c0ea9d16579ec | [
"Apache-2.0"
] | 1 | 2021-08-11T15:41:19.000Z | 2021-08-11T15:41:19.000Z | problems/LongestCommonPrefix.py | strambake/data-structures-and-algorithms | 739ded4b9b2feaf0da5a7383558c0ea9d16579ec | [
"Apache-2.0"
] | 5 | 2021-08-11T12:37:08.000Z | 2021-09-04T04:49:12.000Z | problems/LongestCommonPrefix.py | strambake/data-structures-and-algorithms | 739ded4b9b2feaf0da5a7383558c0ea9d16579ec | [
"Apache-2.0"
] | null | null | null | # Write a function to find the longest common prefix string amongst an array of strings.
# If there is no common prefix, return an empty string "".
#
# Example 1:
# Input: strs = ["flower","flow","flight"]
# Output: "fl"
#
# Example 2:
# Input: strs = ["dog","racecar","car"]
# Output: ""
# Explanation: There is no comm... | 29.145833 | 122 | 0.521086 |
from typing import List
from unittest import TestCase
class Solution():
def longestCommonPrefix(self, strs: List[str]) -> str:
prefix = ''
if strs:
for index, char in enumerate(strs[0]):
match = True
for s in strs[1:]:
if... | true | true |
f7473ad3988c149aed70525ff06fa9bee50bfa42 | 3,385 | py | Python | resnext_wsl.py | PudPawat/protest-detection-violence-estimation | 6469c3ae47a7d99308458174fe16bd2c5c7821aa | [
"MIT"
] | 2 | 2020-12-10T01:22:13.000Z | 2021-03-11T08:05:16.000Z | resnext_wsl.py | PudPawat/protest-detection-violence-estimation | 6469c3ae47a7d99308458174fe16bd2c5c7821aa | [
"MIT"
] | null | null | null | resnext_wsl.py | PudPawat/protest-detection-violence-estimation | 6469c3ae47a7d99308458174fe16bd2c5c7821aa | [
"MIT"
] | null | null | null |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# Optional list of dependencies required by the package
'''
Code From : https://github.com/facebookresearch/WSL-Image... | 40.297619 | 97 | 0.721123 |
dependencies = ['torch', 'torchvision']
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from Res import ResNet, Bottleneck
model_urls = {
'resnext101_32x8d': 'https://download.pytorch.org/models/i... | true | true |
f7473b06ffd22517f77fcbd81873eb9f34b33b02 | 6,158 | py | Python | src/sqlfluff/rules/L018.py | zhongjiajie/sqlfluff | bedf8018d8b21ae906f49e265d111b322bb6ef7d | [
"MIT"
] | 2 | 2021-08-04T08:58:33.000Z | 2021-08-04T18:54:06.000Z | src/sqlfluff/rules/L018.py | linchun3/sqlfluff | 0bfa5339380ecd040252e8fa4326a4b4c8c8ed86 | [
"MIT"
] | null | null | null | src/sqlfluff/rules/L018.py | linchun3/sqlfluff | 0bfa5339380ecd040252e8fa4326a4b4c8c8ed86 | [
"MIT"
] | null | null | null | """Implementation of Rule L018."""
from sqlfluff.core.parser import NewlineSegment, WhitespaceSegment
from sqlfluff.core.rules.base import BaseRule, LintFix, LintResult
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@document_fix_compatible
class Rule_L018(BaseRule):
"""WITH clause closi... | 41.608108 | 88 | 0.427736 |
from sqlfluff.core.parser import NewlineSegment, WhitespaceSegment
from sqlfluff.core.rules.base import BaseRule, LintFix, LintResult
from sqlfluff.core.rules.doc_decorators import document_fix_compatible
@document_fix_compatible
class Rule_L018(BaseRule):
_works_on_unparsable = False
config_keywords = ["t... | true | true |
f7473b1160219337ac76c72c05af3b210f68ff11 | 7,115 | py | Python | models/mnist_ses.py | spetrescu/sesn | 43ecc5da7083364eea2c66742c17231c18465973 | [
"MIT"
] | 55 | 2020-02-13T17:44:25.000Z | 2022-03-08T04:26:34.000Z | models/mnist_ses.py | spetrescu/sesn | 43ecc5da7083364eea2c66742c17231c18465973 | [
"MIT"
] | 1 | 2021-07-09T21:49:17.000Z | 2021-07-10T15:12:33.000Z | models/mnist_ses.py | spetrescu/sesn | 43ecc5da7083364eea2c66742c17231c18465973 | [
"MIT"
] | 7 | 2020-02-13T19:41:46.000Z | 2021-09-20T17:23:27.000Z | '''MIT License. Copyright (c) 2020 Ivan Sosnovik, Michał Szmaja'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from .impl.ses_conv import SESMaxProjection
from .impl.ses_conv import SESConv_Z2_H, SESConv_H_H
class MNIST_SES_Scalar(nn.Module):
def __init__(self, pool_size=4, kernel_size=11... | 32.637615 | 105 | 0.561068 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .impl.ses_conv import SESMaxProjection
from .impl.ses_conv import SESConv_Z2_H, SESConv_H_H
class MNIST_SES_Scalar(nn.Module):
def __init__(self, pool_size=4, kernel_size=11, scales=[1.0], basis_type='A', **kwargs):
super().__init__... | true | true |
f7473b6a769b0d0aa12b04c27b125f1650742ad1 | 603 | py | Python | Django/HomeworksProject/home/migrations/0005_friend_current_user.py | svyhlidka/Python-Projects | 7c297bf7248a1e61699a69d62eb83f15cf90d352 | [
"MIT"
] | null | null | null | Django/HomeworksProject/home/migrations/0005_friend_current_user.py | svyhlidka/Python-Projects | 7c297bf7248a1e61699a69d62eb83f15cf90d352 | [
"MIT"
] | null | null | null | Django/HomeworksProject/home/migrations/0005_friend_current_user.py | svyhlidka/Python-Projects | 7c297bf7248a1e61699a69d62eb83f15cf90d352 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-09-01 19:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('home', '0004_friend'),
... | 27.409091 | 144 | 0.676617 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('home', '0004_friend'),
]
operations = [
migrations.Add... | true | true |
f7473bd19b09010283929cec3e3a14a53e1a3ae6 | 8,283 | py | Python | test/functional/bsv-block-size-activation-generated-default.py | slashrsm/bitcoin-sv | f5503f0fe1a30db70b9a07b2a22e27468bf1b59a | [
"OML"
] | 2 | 2019-08-04T17:48:00.000Z | 2021-02-15T19:17:47.000Z | test/functional/bsv-block-size-activation-generated-default.py | slashrsm/bitcoin-sv | f5503f0fe1a30db70b9a07b2a22e27468bf1b59a | [
"OML"
] | null | null | null | test/functional/bsv-block-size-activation-generated-default.py | slashrsm/bitcoin-sv | f5503f0fe1a30db70b9a07b2a22e27468bf1b59a | [
"OML"
] | 1 | 2021-04-03T05:58:34.000Z | 2021-04-03T05:58:34.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
Test that the new default generated (mined) block size works correctly without the use
of the blockmaxsize parameter.
In short; if the user doesn't override things v... | 45.262295 | 122 | 0.698418 |
import math
from test_framework.test_framework import BitcoinTestFramework, SkipTest
from test_framework.util import *
from test_framework.mininode import *
from test_framework.script import CScript, OP_TRUE, OP_RETURN
from test_framework.blocktools import *
from test_framework.cdefs import (ONE_MEGABYTE, MAX_TX_SI... | true | true |
f7473bf34b91a8372b626e42e846963d1c1340ee | 3,225 | py | Python | Lib/xml/dom/html/HTMLScriptElement.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | Lib/xml/dom/html/HTMLScriptElement.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | Lib/xml/dom/html/HTMLScriptElement.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | ########################################################################
#
# File Name: HTMLScriptElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLScriptElement.html
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-ma... | 27.801724 | 78 | 0.603101 | true | true | |
f7473c7d54e10cff5326af83ded330b2f0bc80bf | 1,402 | py | Python | xlsxwriter/test/comparison/test_chart_axis19.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/comparison/test_chart_axis19.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_axis19.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 25.490909 | 79 | 0.563481 | true | true | |
f7473c8a9fa54b5f004f7948458934372837e46b | 4,040 | py | Python | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import numpy as np
sys.path.append("../")
import mocsy
# Define input data (typical values at depth from 0 to 5000 meters)
temp = np.repeat(2.0, 6).astype('float32')
depth = np.arange (0, 6000, 1000).astype('float32')
sal = np.repeat(35.0, 6).astype('float32')
alk = np.repeat(2295.*1... | 45.393258 | 217 | 0.603465 |
import sys
import numpy as np
sys.path.append("../")
import mocsy
temp = np.repeat(2.0, 6).astype('float32')
depth = np.arange (0, 6000, 1000).astype('float32')
sal = np.repeat(35.0, 6).astype('float32')
alk = np.repeat(2295.*1.e-6, 6).astype('float32')
dic = np.repeat(2154.*1.e-6, 6).astype('float32')
sil = phos = ... | true | true |
f7473d2b7e3f2cef9221158655b9635665d65edd | 13,306 | py | Python | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 60 | 2018-01-12T07:33:15.000Z | 2021-12-28T23:06:28.000Z | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 13 | 2018-01-23T00:14:35.000Z | 2020-04-23T00:03:31.000Z | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 13 | 2018-01-05T07:27:29.000Z | 2021-01-06T16:45:05.000Z | import binascii
import pprint
import time
from neocore.BigInteger import BigInteger
from neocore.Cryptography.Crypto import Crypto
from TX.MyTransaction import InvocationTransaction
from TX.TransactionAttribute import TransactionAttribute, TransactionAttributeUsage
from TX.config import *
# from TX.interface import cre... | 102.353846 | 2,757 | 0.885014 | import binascii
import pprint
import time
from neocore.BigInteger import BigInteger
from neocore.Cryptography.Crypto import Crypto
from TX.MyTransaction import InvocationTransaction
from TX.TransactionAttribute import TransactionAttribute, TransactionAttributeUsage
from TX.config import *
from TX.interface import cre... | true | true |
f7473ed88b053755c72c2313785966efbee32ec9 | 1,347 | py | Python | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE2TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | 1 | 2020-05-10T11:23:11.000Z | 2020-05-10T11:23:11.000Z | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from collections import defaultdict
import sys
from typing import Any
class TimeSeries(object):
def __init__(self):
self.class_timeseries = ''
self.dimension_name = ''
self.discmP = {}
self.threshP = {}
self.timeseries = None
self.matched = False
... | 31.325581 | 76 | 0.616927 | import numpy as np
from collections import defaultdict
import sys
from typing import Any
class TimeSeries(object):
def __init__(self):
self.class_timeseries = ''
self.dimension_name = ''
self.discmP = {}
self.threshP = {}
self.timeseries = None
self.matched = False
... | true | true |
f7473efbcb48dc795ca5e0d7fc30095e44a5f4cd | 3,466 | py | Python | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Bacillus litoralis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... | 33.009524 | 223 | 0.677149 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def BacillusLitoralis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string"... | true | true |
f7473f06895a418f06a11e200d89fe5fc186b65d | 1,773 | py | Python | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | 1 | 2021-08-19T07:16:22.000Z | 2021-08-19T07:16:22.000Z | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | null | null | null | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | 1 | 2021-08-19T07:16:24.000Z | 2021-08-19T07:16:24.000Z | import psycopg2
import argparse
import getpass
# define arguments
parser = argparse.ArgumentParser(description='Creates bounding boxes for OSM relations')
parser.add_argument('hostname', help='PostgreSQL hostname')
parser.add_argument('db', help='PostgreSQL database name')
parser.add_argument('username', help='Postgre... | 34.096154 | 169 | 0.63057 | import psycopg2
import argparse
import getpass
parser = argparse.ArgumentParser(description='Creates bounding boxes for OSM relations')
parser.add_argument('hostname', help='PostgreSQL hostname')
parser.add_argument('db', help='PostgreSQL database name')
parser.add_argument('username', help='PostgreSQL username')
a... | true | true |
f7473f10bb4f9fc15e282b1389b1f0f964732dc3 | 1,555 | py | Python | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | 10 | 2016-01-06T09:35:59.000Z | 2021-09-14T18:24:14.000Z | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | null | null | null | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | 9 | 2015-09-01T18:33:55.000Z | 2022-03-09T21:53:02.000Z | # Copyright (c) 2014-2015, Heliosphere Research LLC
# 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. Redistributions of source code must retain the above copyright notice,
# this list of c... | 55.535714 | 77 | 0.789068 | true | true | |
f7473f4fb847e44106df41ef5db87004cef977f9 | 1,410 | py | Python | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | import datetime
from django.test import TestCase
from django.utils import timezone
from catalog.forms import RenewBookForm
class RenewBookFormTest(TestCase):
def test_renew_form_date_field_label(self):
form = RenewBookForm()
self.assertTrue(form.fields['renewal_date'].label == None or form.fields... | 40.285714 | 121 | 0.703546 | import datetime
from django.test import TestCase
from django.utils import timezone
from catalog.forms import RenewBookForm
class RenewBookFormTest(TestCase):
def test_renew_form_date_field_label(self):
form = RenewBookForm()
self.assertTrue(form.fields['renewal_date'].label == None or form.fields... | true | true |
f7473f9bcbbdfe4db020b9ee33054523c21445ea | 53,231 | py | Python | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | 1 | 2022-03-29T16:39:04.000Z | 2022-03-29T16:39:04.000Z | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | null | null | null | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | null | null | null | from decimal import Decimal
import pytest
from vyper.exceptions import (
ArgumentException,
InvalidType,
StateAccessViolation,
StructureException,
UndeclaredDefinition,
UnknownType,
)
def test_external_contract_calls(get_contract, get_contract_with_gas_estimation):
contract_1 = """
@exte... | 22.954291 | 100 | 0.650843 | from decimal import Decimal
import pytest
from vyper.exceptions import (
ArgumentException,
InvalidType,
StateAccessViolation,
StructureException,
UndeclaredDefinition,
UnknownType,
)
def test_external_contract_calls(get_contract, get_contract_with_gas_estimation):
contract_1 = """
@exte... | true | true |
f74740db426c1d0b29641e37aab58ddf2d55e5ce | 21,701 | py | Python | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.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... | 45.590336 | 99 | 0.664854 | true | true | |
f74740dd9d56b8dcecd61271bc0b2ca5847345a1 | 1,533 | py | Python | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | null | null | null | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | null | null | null | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | 1 | 2018-09-11T12:01:52.000Z | 2018-09-11T12:01:52.000Z | #
# SensApp::Storage
#
# Copyright (C) 2018 SINTEF Digital
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
import yaml
import logging
import logging.config
from storage.queues import QueueListener
from storage.db im... | 24.725806 | 78 | 0.688193 |
import yaml
import logging
import logging.config
from storage.queues import QueueListener
from storage.db import DBListener
from storage.sensapp import RegistryListener
STARTING_UP = "Starting ..."
DB_CONNECTED = "Connected to DB '{name}' on {host}:{port}."
QUEUE_CONNECTED = "Connected to message-queue ... | true | true |
f74741241a5c1671f8eaad0d0bef640e9bcc1af8 | 39,505 | py | Python | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | 1 | 2021-03-14T15:55:25.000Z | 2021-03-14T15:55:25.000Z | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | null | null | null | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | null | null | null | """ Normalization Free Nets. NFNet, NF-RegNet, NF-ResNet (pre-activation) Models
Paper: `Characterizing signal propagation to close the performance gap in unnormalized ResNets`
- https://arxiv.org/abs/2101.08692
Paper: `High-Performance Large-Scale Image Recognition Without Normalization`
- https://arxiv.org/... | 42.161153 | 129 | 0.670244 | import math
from dataclasses import dataclass, field
from collections import OrderedDict
from typing import Tuple, Optional
from functools import partial
import torch
import torch.nn as nn
from .helpers import build_model_with_cfg
from .layers import ClassifierHead, DropPath, AvgPool2dSame, ScaledStdConv2d, ScaledSt... | true | true |
f747412c04085f26b2351414e2a407389f589f98 | 461 | py | Python | data/scripts/templates/object/mobile/shared_dressed_commoner_artisan_bith_male_01.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_dressed_commoner_artisan_bith_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_commoner_artisan_bith_male_01.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_dressed_commoner_artisan_bith_male_01.iff"
result.attribute_te... | 27.117647 | 83 | 0.739696 | true | true | |
f747413d92571cc1b3c81399e72ff497438caf61 | 1,027 | py | Python | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import string
import random
# this will generate a random key used for the XOR encrpytion for 1kb = same as the TCP socket size
key = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + '^!\$%&/()=?{[]}+~#-_.:,;<>|\\') for _ in range(1024))
# printing data
print(k... | 34.233333 | 148 | 0.683544 |
import string
import random
key = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + '^!\$%&/()=?{[]}+~#-_.:,;<>|\\') for _ in range(1024))
print(key)
print('\n' + 'Key length' + str(len(key)))
message = 'ipconfig'
print("Hardcoded message is: " + message + "\n")
def str_xor... | true | true |
f74741961ca57072c59db5ab77aa0c05719b4ee8 | 2,103 | py | Python | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | null | null | null | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | null | null | null | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | 1 | 2021-12-15T12:18:27.000Z | 2021-12-15T12:18:27.000Z | import os
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import JSONFormatter
from argparse import ArgumentParser, Namespace
from tqdm import tqdm
from typing import List
def _get_video_id_from_url(url: str) -> str:
assert "watch?v=" in url, "URL format is incorre... | 34.47541 | 115 | 0.673799 | import os
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import JSONFormatter
from argparse import ArgumentParser, Namespace
from tqdm import tqdm
from typing import List
def _get_video_id_from_url(url: str) -> str:
assert "watch?v=" in url, "URL format is incorre... | true | true |
f74741c069ee1b6a4ae1b7ff6d986f2ce19bf3a7 | 4,568 | py | Python | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... | 39.042735 | 85 | 0.336033 | def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... | true | true |
f747424770a430e5746e2ab2f78345201bd4e217 | 493 | py | Python | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-10-07T00:37:32.000Z | 2022-01-21T17:02:33.000Z | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | null | null | null | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-05-09T14:23:57.000Z | 2018-11-15T05:56:00.000Z | #!/usr/bin/env python
import os
from glob import glob
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('lapack',parent_package,top_path)
config.add_sconscript('SConstruct')
... | 23.47619 | 60 | 0.744422 |
import os
from glob import glob
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('lapack',parent_package,top_path)
config.add_sconscript('SConstruct')
config.add_data_d... | true | true |
f74742b30c7f6e4f0a6cb009fcffe7a422b6f348 | 6,731 | py | Python | tests/unit/beacons/test_btmp.py | calinrailean/salt | 6283b51bb44b734a3db82caaae4f4c4e32a9b9b3 | [
"Apache-2.0"
] | 2 | 2018-11-08T02:59:24.000Z | 2021-01-04T00:30:50.000Z | tests/unit/beacons/test_btmp.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | 4 | 2020-09-04T10:19:34.000Z | 2020-11-09T12:55:59.000Z | tests/unit/beacons/test_btmp.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | 5 | 2017-06-16T23:48:13.000Z | 2021-04-08T17:43:48.000Z | # coding: utf-8
# Python libs
from __future__ import absolute_import
import logging
# Salt testing libs
from tests.support.unit import skipIf, TestCase
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
from tests.support.mixins import LoaderModuleMockMixin
# Salt libs
import salt.be... | 57.042373 | 1,485 | 0.567821 |
from __future__ import absolute_import
import logging
from tests.support.unit import skipIf, TestCase
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
from tests.support.mixins import LoaderModuleMockMixin
import salt.beacons.btmp as btmp
from salt.ext import six
raw = b'\x06\... | true | true |
f7474314b30bb1d5a8ea527a26aa09669052cfe8 | 642 | py | Python | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='wangle',
version='0.1.3',
author="Ben Harpin",
author_email="benjaminharpin@gmail.com",
description="A python library for natural language manipulation.",
long_description=long_descr... | 29.181818 | 70 | 0.672897 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='wangle',
version='0.1.3',
author="Ben Harpin",
author_email="benjaminharpin@gmail.com",
description="A python library for natural language manipulation.",
long_description=long_descr... | true | true |
f7474325224135894bafb1ad8a851a6ca90d158a | 356 | py | Python | dgp/genera/load/analyzers/file_format/gsheet_format.py | dataspot/dgp | 553a255a4884b935cf2efecdc761050232f0f066 | [
"MIT"
] | 1 | 2019-07-17T11:34:27.000Z | 2019-07-17T11:34:27.000Z | dgp/genera/load/analyzers/file_format/gsheet_format.py | datahq/dgp | f39592ce20ba67b73b08188f14585b6eb3d43f96 | [
"MIT"
] | 2 | 2019-04-30T12:32:32.000Z | 2019-04-30T12:35:26.000Z | dgp/genera/load/analyzers/file_format/gsheet_format.py | dataspot/dgp | 553a255a4884b935cf2efecdc761050232f0f066 | [
"MIT"
] | null | null | null | from .....core import BaseAnalyzer, Validator, Required
from .....config.consts import CONFIG_FORMAT, CONFIG_FORCE_STRINGS
class GSheetFormatAnalyzer(BaseAnalyzer):
REQUIRES = Validator(
Required(CONFIG_FORMAT)
)
def run(self):
if self.config[CONFIG_FORMAT] == 'gsheet':
self.... | 25.428571 | 66 | 0.696629 | from .....core import BaseAnalyzer, Validator, Required
from .....config.consts import CONFIG_FORMAT, CONFIG_FORCE_STRINGS
class GSheetFormatAnalyzer(BaseAnalyzer):
REQUIRES = Validator(
Required(CONFIG_FORMAT)
)
def run(self):
if self.config[CONFIG_FORMAT] == 'gsheet':
self.... | true | true |
f747438358366586d9084873c047f182733c831f | 38,574 | py | Python | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.135011 | 112 | 0.61163 |
import tensorflow.compat.v2 as tf
from absl.testing import parameterized
import numpy as np
import keras
from keras import combinations
from keras import testing_utils
from keras.layers import core
from keras.layers import dense_attention
from keras.mixed_precision import policy
@combinations.generat... | true | true |
f7474475791976c3594638ab0dd1c732889b5a29 | 8,838 | py | Python | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 121 | 2018-06-18T19:16:42.000Z | 2022-03-31T06:06:48.000Z | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 492 | 2018-06-22T19:41:03.000Z | 2022-03-31T15:33:53.000Z | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 43 | 2018-06-19T01:43:13.000Z | 2022-03-23T22:43:37.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 40.541284 | 222 | 0.687825 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetKMSCryptoKeyResult',
'AwaitableGetKMSCryptoKeyResult',
'get_kms_crypto_key',
'get_kms_crypto_key_output',
]
@pulu... | true | true |
f747450525114f8779287131a65d33e0cf2eb37a | 1,852 | py | Python | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 9 | 2018-09-23T17:34:23.000Z | 2021-07-29T09:48:55.000Z | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 2 | 2020-04-15T17:52:18.000Z | 2020-04-15T18:26:27.000Z | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 6 | 2019-04-30T22:01:43.000Z | 2021-11-22T02:20:18.000Z | from generative_playground.models.encoder.basic_cnn import SimpleCNNEncoder
from generative_playground.models.encoder.basic_rnn import SimpleRNN
from generative_playground.models.heads.attention_aggregating_head import AttentionAggregatingHead
from generative_playground.models.transformer.Models import TransformerEncod... | 50.054054 | 98 | 0.542117 | from generative_playground.models.encoder.basic_cnn import SimpleCNNEncoder
from generative_playground.models.encoder.basic_rnn import SimpleRNN
from generative_playground.models.heads.attention_aggregating_head import AttentionAggregatingHead
from generative_playground.models.transformer.Models import TransformerEncod... | true | true |
f747456615108cf6c3999e493a8f04a003c1b65c | 1,704 | py | Python | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | 7 | 2019-03-18T10:33:40.000Z | 2020-03-10T17:25:17.000Z | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | null | null | null | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | 5 | 2019-03-18T10:33:47.000Z | 2021-04-17T08:16:49.000Z | from urllib.parse import quote_plus as url_quoteplus
from urllib.parse import urlsplit
from selenium.webdriver.common.by import By as WebBy
from selenium.webdriver.support.ui import Select as WebSelect
def allow_flash(driver, url):
def _base_url(url):
if url.find("://") == -1:
url = "http://{}... | 44.842105 | 95 | 0.72007 | from urllib.parse import quote_plus as url_quoteplus
from urllib.parse import urlsplit
from selenium.webdriver.common.by import By as WebBy
from selenium.webdriver.support.ui import Select as WebSelect
def allow_flash(driver, url):
def _base_url(url):
if url.find("://") == -1:
url = "http://{}... | true | true |
f74745823024a0e28bb05c7d7daa838c1f84db0f | 282 | py | Python | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
def get_end(self):
"""Return the end point of the arc
Parameters
----------
self : Arc3
An Arc3 object
Returns
-------
end: complex
Complex coordinates of the end point of the Arc3
"""
return self.end
| 14.842105 | 56 | 0.528369 |
def get_end(self):
return self.end
| true | true |
f747462b46a193c2ea52b43b50a2b2dff1c704d6 | 1,304 | py | Python | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 2,293 | 2015-08-14T22:39:31.000Z | 2022-03-31T12:44:49.000Z | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 676 | 2015-08-20T19:29:56.000Z | 2022-03-31T13:45:51.000Z | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 255 | 2015-12-02T21:16:33.000Z | 2022-03-20T22:03:46.000Z | from dynaconf import Dynaconf
settings_files = ["settings.toml", "other.toml"]
settings = Dynaconf(settings_files=settings_files)
expected_value = "s3a://kewl_bucket"
assert settings.s3_url == expected_value
assert settings.s3_url1 == expected_value
assert settings.s3_url2 == expected_value
assert settings.s3_url3 ... | 24.603774 | 73 | 0.680215 | from dynaconf import Dynaconf
settings_files = ["settings.toml", "other.toml"]
settings = Dynaconf(settings_files=settings_files)
expected_value = "s3a://kewl_bucket"
assert settings.s3_url == expected_value
assert settings.s3_url1 == expected_value
assert settings.s3_url2 == expected_value
assert settings.s3_url3 ... | true | true |
f747465717af7b61ba3d5809bb0103759c609741 | 1,198 | py | Python | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | from discord.ext import commands
import os
import discord
import random
token = 'token'
bot = discord.Client()
bot = commands.Bot(command_prefix='!')
bot.remove_command('help')
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"cogs.{name}... | 36.30303 | 116 | 0.687813 | from discord.ext import commands
import os
import discord
import random
token = 'token'
bot = discord.Client()
bot = commands.Bot(command_prefix='!')
bot.remove_command('help')
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"cogs.{name}... | true | true |
f74747271f5d3bf42eb9e4ddfecd242716713e4f | 437 | py | Python | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | from stard.services import Executable
class Service(Executable):
start_command = ('mount', '-a')
post_start_commands = (
('mount', '-o', 'remount,rw', '/'),
)
stop_command = ('sh', '-c', 'umount -af; true')
post_stop_commands = (
('mount', '-o', 'remount,ro', '/'),
)
onesh... | 23 | 51 | 0.567506 | from stard.services import Executable
class Service(Executable):
start_command = ('mount', '-a')
post_start_commands = (
('mount', '-o', 'remount,rw', '/'),
)
stop_command = ('sh', '-c', 'umount -af; true')
post_stop_commands = (
('mount', '-o', 'remount,ro', '/'),
)
onesh... | true | true |
f74747b189e324008b25d3404bc8817e39045f29 | 7,799 | py | Python | src/you_get/extractors/netease.py | ARTAvrilLavigne/you-get | 904a88841899091415015b297c9293f980c8ba24 | [
"MIT"
] | 48 | 2017-12-24T12:19:55.000Z | 2022-02-26T13:14:27.000Z | src/you_get/extractors/netease.py | T-K-233/you-get | ff6deaf2bde4a8e81094c7ff5893fa4d9b30efb0 | [
"MIT"
] | 6 | 2016-10-19T12:52:06.000Z | 2018-05-26T10:32:51.000Z | src/you_get/extractors/netease.py | T-K-233/you-get | ff6deaf2bde4a8e81094c7ff5893fa4d9b30efb0 | [
"MIT"
] | 113 | 2017-08-09T03:10:04.000Z | 2022-03-26T16:05:01.000Z | #!/usr/bin/env python
__all__ = ['netease_download']
from ..common import *
from ..common import print_more_compatible as print
from ..util import fs
from json import loads
import hashlib
import base64
import os
def netease_hymn():
return """
player's Game Over,
u can abandon.
u get pissed,
get ... | 42.38587 | 169 | 0.597384 |
__all__ = ['netease_download']
from ..common import *
from ..common import print_more_compatible as print
from ..util import fs
from json import loads
import hashlib
import base64
import os
def netease_hymn():
return """
player's Game Over,
u can abandon.
u get pissed,
get pissed,
Halleluja... | true | true |
f74747ef90da8cd6fe6b37a74e293aeb84409af8 | 11,233 | py | Python | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... | 34.457055 | 114 | 0.616754 | import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... | true | true |
f74747fd63350079355397ba5d7eb5c20324d9bc | 2,469 | py | Python | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 10 | 2019-03-22T07:07:41.000Z | 2022-01-26T00:57:45.000Z | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 70 | 2017-07-12T19:49:38.000Z | 2020-09-02T10:03:28.000Z | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 2 | 2017-06-30T07:13:39.000Z | 2020-12-04T00:39:12.000Z | """
Category queries application file.
"""
from lib import database as db
def printAvailableCategories():
"""
Iterate through Categories in db to print out name and Profile count
for each.
:return: None
"""
print(" Category | Profiles")
print("------------------------... | 29.392857 | 80 | 0.567436 | from lib import database as db
def printAvailableCategories():
print(" Category | Profiles")
print("-------------------------------+---------")
categoryResult = db.Category.select()
for i, v in enumerate(categoryResult):
print(
"{index:3d}. {category:25s} | {pr... | true | true |
f7474812853343b99a417134f794f8b54648ff3b | 5,852 | py | Python | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 26 | 2016-11-02T15:46:29.000Z | 2022-03-18T16:50:00.000Z | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 419 | 2017-06-07T16:06:22.000Z | 2022-03-25T21:05:17.000Z | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 12 | 2017-07-25T22:58:08.000Z | 2022-02-17T23:30:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Rogue documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 15 13:57:19 2018.
#
# 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
# auto... | 30.962963 | 95 | 0.679255 |
import rogue
import breathe
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sph... | true | true |
f747483c10d80c5d09d2d15129164a71cb07b228 | 4,284 | py | Python | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | from users.models import Users
from .serializers import UsersSerializer
from rest_framework import viewsets
from django.contrib.auth.hashers import make_password
from rest_framework.response import Response
from rest_framework.decorators import api_view, action
from users.models import Users
from clients.models import ... | 27.818182 | 85 | 0.601541 | from users.models import Users
from .serializers import UsersSerializer
from rest_framework import viewsets
from django.contrib.auth.hashers import make_password
from rest_framework.response import Response
from rest_framework.decorators import api_view, action
from users.models import Users
from clients.models import ... | true | true |
f747489942094fdb9d96922740a78b15a74dec0e | 4,796 | py | Python | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | import base64
from django.core import mail
from django.utils.six.moves import cPickle as pickle
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from ..conf import settings
from ..models import... | 37.46875 | 103 | 0.68015 | import base64
from django.core import mail
from django.utils.six.moves import cPickle as pickle
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from ..conf import settings
from ..models import... | true | true |
f7474971492e22c5b28f459c7bf3ba7e80bfc150 | 1,279 | py | Python | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 412 | 2015-02-25T11:07:09.000Z | 2022-03-28T10:03:09.000Z | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 240 | 2015-02-24T18:10:13.000Z | 2022-03-22T11:10:09.000Z | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 238 | 2015-02-24T16:12:32.000Z | 2022-03-30T08:50:29.000Z | import logging
import snap7
# for setup the Logo connection please follow this link
# http://snap7.sourceforge.net/logo.html
logging.basicConfig(level=logging.INFO)
# Siemens LOGO devices Logo 8 is the default
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0... | 23.685185 | 68 | 0.645817 | import logging
import snap7
logging.basicConfig(level=logging.INFO)
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0x1000,0x2000)
if plc.get_connected():
logger.info("connected")
vm_address = ("V923.0" if Logo_7==True else "V1024.0")
... | true | true |
f74749ad574e549af5156c74722aa49c9d720eee | 3,576 | py | Python | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 7 | 2016-04-24T19:06:10.000Z | 2018-10-03T16:33:51.000Z | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 3 | 2017-05-24T06:58:14.000Z | 2020-02-15T14:21:00.000Z | # Copyright 2015 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... | 32.216216 | 80 | 0.81264 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework.ops import Graph
from tensorflow.python.framework.ops import Operation
from tensorflow.python.framework.ops import Tensor
from tensorflow.python.framework.ops ... | true | true |
f7474a1373c21bb00f7cb798beb6317f18e97a79 | 3,807 | py | Python | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 14 | 2017-03-28T16:32:24.000Z | 2021-03-13T23:03:57.000Z | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 8 | 2017-03-01T07:56:09.000Z | 2017-08-15T07:37:12.000Z | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 14 | 2017-04-08T20:01:50.000Z | 2017-08-19T04:23:57.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/responses/get_player_response.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from... | 40.5 | 396 | 0.78093 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7474a189b45f9046d3cbf6699be9546d8eebfd1 | 11,398 | py | Python | venv/lib/python3.7/site-packages/celery/backends/mongodb.py | joeybaba/incubator-superset | fc6fc042b4acbc564b69011532a92cf88d21a609 | [
"Apache-2.0"
] | 1 | 2021-09-13T07:49:56.000Z | 2021-09-13T07:49:56.000Z | newenv/lib/python3.8/site-packages/celery/backends/mongodb.py | palakshivlani-11/cryptorium | eebb78c061007519e527b3d18b8df6bc13679c46 | [
"Apache-2.0"
] | 9 | 2021-03-19T03:06:53.000Z | 2022-03-12T00:37:04.000Z | newenv/lib/python3.8/site-packages/celery/backends/mongodb.py | palakshivlani-11/cryptorium | eebb78c061007519e527b3d18b8df6bc13679c46 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""MongoDB result store backend."""
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from kombu.exceptions import EncodeError
from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url, urlparse
from celery i... | 34.539394 | 79 | 0.584576 |
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from kombu.exceptions import EncodeError
from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url, urlparse
from celery import states
from celery.exceptions import ImproperlyConfig... | true | true |
f7474a398c5a316b12711816b58fb045c86d4e1a | 7,414 | py | Python | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 27.76779 | 79 | 0.578635 |
import sys
import textwrap
import unittest
from lib2to3 import pytree
from yapf.pytree import pytree_utils
from yapf.pytree import pytree_visitor
from yapf.pytree import split_penalty
from yapf.yapflib import style
from yapftests import yapf_test_helper
UNBREAKABLE = split_penalty.UNBREAKABLE
VERY_STR... | true | true |
f7474a67a7116bd40a56fbc2cc7a628d21210378 | 1,562 | py | Python | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | """
A tool to notify Docker contianers about changes in mounts on Windows.
"""
import re
import argparse
import logging
import pywintypes
from docker_volume_watcher.container_monitor import ContainerMonitor
def main():
"""
Parse command line arguments and start monitoring.
"""
parser = argparse.Argu... | 33.956522 | 99 | 0.678617 | import re
import argparse
import logging
import pywintypes
from docker_volume_watcher.container_monitor import ContainerMonitor
def main():
parser = argparse.ArgumentParser(
description='A tool to notify Docker contianers about changes in mounts on Windows.'
)
parser.add_argument('container_patt... | true | true |
f7474c4b301e0ea093a9d28e778968748adb98fb | 3,296 | py | Python | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | 7 | 2021-04-24T16:26:57.000Z | 2021-09-04T00:31:45.000Z | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | null | null | null | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | 4 | 2021-04-16T14:25:07.000Z | 2022-02-04T12:32:42.000Z | from rest_framework.serializers import ModelSerializer as DefaultModelSerializer
from rest_framework.validators import UniqueValidator, UniqueTogetherValidator
from rest_framework.fields import JSONField
from ..fields import JSONBField
DefaultModelSerializer.serializer_field_mapping[JSONBField] = JSONField
class Mo... | 39.710843 | 80 | 0.614684 | from rest_framework.serializers import ModelSerializer as DefaultModelSerializer
from rest_framework.validators import UniqueValidator, UniqueTogetherValidator
from rest_framework.fields import JSONField
from ..fields import JSONBField
DefaultModelSerializer.serializer_field_mapping[JSONBField] = JSONField
class Mo... | true | true |
f7474ccb88a5353fdeef8637674dd61354991130 | 348 | py | Python | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | import torch
from inference_Alexnet import AlexNet
def main():
pytorch_model = AlexNet()
pytorch_model.load_state_dict(torch.load('cifar100_Alexnet.pt'))
pytorch_model.eval()
dummy_input = torch.zeros(128*128*4)
torch.onnx.export(pytorch_model, dummy_input, 'cifar100_Alexnet.onnx', verbose=True)
if __nam... | 21.75 | 86 | 0.758621 | import torch
from inference_Alexnet import AlexNet
def main():
pytorch_model = AlexNet()
pytorch_model.load_state_dict(torch.load('cifar100_Alexnet.pt'))
pytorch_model.eval()
dummy_input = torch.zeros(128*128*4)
torch.onnx.export(pytorch_model, dummy_input, 'cifar100_Alexnet.onnx', verbose=True)
if __nam... | true | true |
f7474d843326d97c18cf8a1992d27f47a4b4ca41 | 1,063 | py | Python | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | null | null | null | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | 1 | 2020-06-05T18:34:13.000Z | 2020-06-05T18:34:13.000Z | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | null | null | null | """pareeksha URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 36.655172 | 79 | 0.71778 | from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView
from users import urls as auth_urls
from online_tests import urls as online_test_urls
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/auth/', include(auth_urls)),
url(r'^ap... | true | true |
f7474dd15421d4537a8195de47828edb4eeec716 | 19,203 | py | Python | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | 2 | 2020-01-13T20:40:09.000Z | 2020-01-16T15:26:11.000Z | from copy import deepcopy
from django.test import TestCase
from django.core.exceptions import ValidationError
from django.core import management
from avocado.query import oldparsers as parsers
from avocado.models import DataConcept, DataField, DataConceptField
from ....models import Employee
class DataContextParserTe... | 33.396522 | 79 | 0.475447 | from copy import deepcopy
from django.test import TestCase
from django.core.exceptions import ValidationError
from django.core import management
from avocado.query import oldparsers as parsers
from avocado.models import DataConcept, DataField, DataConceptField
from ....models import Employee
class DataContextParserTe... | true | true |
f7474ecb159310ca1054a164e2dbec7ab7e88394 | 3,994 | py | Python | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... | 32.209677 | 79 | 0.61342 | true | true | |
f7474ee80720831ca1657a4d6aedd394513b32c4 | 600 | py | Python | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | import pytest
def pytest_addoption(parser):
parser.addoption(
"--integration", action="store_true", default=False, help="run integration tests (hits N2EX endpoint)"
)
def pytest_configure(config):
config.addinivalue_line("markers", "integration: mark test as slow to run")
def pytest_collection... | 30 | 110 | 0.706667 | import pytest
def pytest_addoption(parser):
parser.addoption(
"--integration", action="store_true", default=False, help="run integration tests (hits N2EX endpoint)"
)
def pytest_configure(config):
config.addinivalue_line("markers", "integration: mark test as slow to run")
def pytest_collection... | true | true |
f74750628ad4fe2e2b560f66d3c8d9d0196b7aa8 | 1,652 | py | Python | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | """Plotting routines."""
from pyvista import MAX_N_COLOR_BARS
from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors,
string_to_rgb, PARAVIEW_BACKGROUND)
from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url
from .helpers import plot, plot_arrows, plot_compare_four, ... | 34.416667 | 78 | 0.697337 |
from pyvista import MAX_N_COLOR_BARS
from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors,
string_to_rgb, PARAVIEW_BACKGROUND)
from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url
from .helpers import plot, plot_arrows, plot_compare_four, plot_itk
from .plotting i... | true | true |
f74751209ae5e4ad5f56488bacf09e5a4eee27b6 | 8,061 | py | Python | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | #coverage:ignore
import dataclasses
import datetime
import math
from typing import Tuple, Iterator
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class MagicStateFactory:
details: str
physical_qubit_footprint: int
rounds: int
failure_rate: int
@dataclasses.dataclass(frozen=True, unsafe_hash=T... | 38.754808 | 80 | 0.65972 |
import dataclasses
import datetime
import math
from typing import Tuple, Iterator
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class MagicStateFactory:
details: str
physical_qubit_footprint: int
rounds: int
failure_rate: int
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class CostE... | true | true |
f74751a7685df7256e7f60828bd1a0ef48803da3 | 2,106 | py | Python | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | null | null | null | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 2 | 2022-03-18T23:12:02.000Z | 2022-03-18T23:59:42.000Z | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from biothings.web.analytics.channels import SlackChannel, GAChannel
from tornado.httpclient import AsyncHTTPClient
from tornado.web import RequestHandler
class Notifier:
def __init__(self, settings):
self.channels = []
if hasattr(settings, 'SLACK_WEBHOOKS'):... | 30.085714 | 70 | 0.628205 | from collections import defaultdict
from biothings.web.analytics.channels import SlackChannel, GAChannel
from tornado.httpclient import AsyncHTTPClient
from tornado.web import RequestHandler
class Notifier:
def __init__(self, settings):
self.channels = []
if hasattr(settings, 'SLACK_WEBHOOKS'):... | true | true |
f74751cdde49ef201b111fdc5328a6b799e22526 | 915 | py | Python | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 2 | 2021-04-23T19:18:06.000Z | 2021-05-15T17:45:21.000Z | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:29:23.000Z | 2021-05-14T00:29:23.000Z | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:19:33.000Z | 2021-05-14T00:19:33.000Z | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... | 36.6 | 120 | 0.549727 | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... | true | true |
f7475334884bbfc81de6163cbb553601437b2d14 | 4,951 | py | Python | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | 1 | 2021-03-05T05:12:44.000Z | 2021-03-05T05:12:44.000Z | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | null | null | null | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 app... | 40.252033 | 124 | 0.704908 |
import os
import ast
import math
import argparse
import numpy as np
import paddle
from paddle.static import InputSpec
from paddlenlp.data import Pad, Tuple, Stack
from paddlenlp.layers.crf import LinearChainCrfLoss, ViterbiDecoder
from paddlenlp.metrics import ChunkEvaluator
import distutils.util
from d... | true | true |
f747533cf3eb62070e06005ab2376d2c74376a4b | 6,924 | py | Python | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | 1 | 2020-04-05T20:19:10.000Z | 2020-04-05T20:19:10.000Z | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | null | null | null | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | null | null | null | """
Code for the combined model approach.
@author: Shashank Swaminathan
"""
from src.BayesReg import GPM
from src.StockRNN import StockRNN
import pandas as pd
import numpy as np
from datetime import datetime
from datetime import date
ZERO_TIME = " 00:00:00"
DEVICE = "cuda" # selects the gpu to be used
TO_GPU_FAIL_... | 50.911765 | 344 | 0.657712 |
from src.BayesReg import GPM
from src.StockRNN import StockRNN
import pandas as pd
import numpy as np
from datetime import datetime
from datetime import date
ZERO_TIME = " 00:00:00"
DEVICE = "cuda"
TO_GPU_FAIL_MSG = "Unable to successfully run model.to('{}'). If running in Collaboratory, make sure " \
... | true | true |
f7475439225a682a84e1c58566d9852acdfa7b1d | 26,890 | py | Python | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:ekr.20170925083314.1: * @file ../plugins/leo_cloud.py
#@+<< docstring >>
#@+node:ekr.20210518113636.1: ** << docstring >>
"""
leo_cloud.py - synchronize Leo subtrees with remote central server
Terry N. Brown, terrynbrown@gmail.com, Fri Sep 22 10:34:10 2017
This plugin allows subtrees within ... | 35.428195 | 108 | 0.597917 |
import json
import os
import re
import shlex
import subprocess
import tempfile
import threading
from copy import deepcopy
from datetime import date, datetime
from hashlib import sha1
from leo.core import leoGlobals as g
from leo.core.leoNodes import vnode
from leo.core.leoQt import QtCore
g.assertUi('qt')
... | true | true |
f747545cbb6dccb4ef4edbe33a59907c9da2ed04 | 2,162 | py | Python | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, generators, nested_scopes, division
import pytest
from reference_database import *
from test_01_storage import test_store_main_table as setup_main_table
import os
from pandas import NaT
import simdb.databaseAPI as api
def setup_module():
setup_main_table()
def map_dateti... | 32.268657 | 93 | 0.624422 | from __future__ import absolute_import, generators, nested_scopes, division
import pytest
from reference_database import *
from test_01_storage import test_store_main_table as setup_main_table
import os
from pandas import NaT
import simdb.databaseAPI as api
def setup_module():
setup_main_table()
def map_dateti... | true | true |
f74755cfb143b17d8705ed510ce499ef7b67ceeb | 416 | py | Python | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 34 | 2019-04-10T17:14:59.000Z | 2022-02-22T11:18:48.000Z | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 65 | 2019-04-10T17:41:07.000Z | 2021-04-02T21:47:27.000Z | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 9 | 2019-04-25T10:35:06.000Z | 2021-06-02T11:06:18.000Z | import pexpect
from ethpm_cli.main import ENTRY_DESCRIPTION
def test_ipfs_scrape(tmp_path):
ipfs_dir = tmp_path / "ipfs"
ipfs_dir.mkdir()
child = pexpect.spawn(f"ethpm scrape --ipfs-dir {ipfs_dir} --start-block 1")
child.expect(ENTRY_DESCRIPTION)
child.expect("\r\n")
child.expect("Scraping fr... | 29.714286 | 80 | 0.713942 | import pexpect
from ethpm_cli.main import ENTRY_DESCRIPTION
def test_ipfs_scrape(tmp_path):
ipfs_dir = tmp_path / "ipfs"
ipfs_dir.mkdir()
child = pexpect.spawn(f"ethpm scrape --ipfs-dir {ipfs_dir} --start-block 1")
child.expect(ENTRY_DESCRIPTION)
child.expect("\r\n")
child.expect("Scraping fr... | true | true |
f74755ebc5b4a57a13cca54986f92da12205f6d0 | 139 | py | Python | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | 1 | 2019-05-21T09:34:41.000Z | 2019-05-21T09:34:41.000Z | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''This module contains one class, Rectangle
'''
class Rectangle:
'''Rectangle is an empty class
'''
pass
| 13.9 | 44 | 0.640288 |
class Rectangle:
pass
| true | true |
f747566f5bec559269873c0063047b47930d8d1d | 6,127 | py | Python | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 33 | 2015-01-06T19:56:26.000Z | 2021-11-30T10:19:58.000Z | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 25 | 2015-01-14T00:33:10.000Z | 2019-11-12T00:19:11.000Z | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 60 | 2015-07-22T21:54:01.000Z | 2022-03-08T20:53:43.000Z | # Copyright (c) 2013-2015, Rethink Robotics
# 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. Redistributions of source code must retain the above copyright notice,
# this list of conditio... | 34.038889 | 77 | 0.605353 |
from copy import deepcopy
from math import fabs
import rospy
from std_msgs.msg import (
Bool
)
import baxter_dataflow
from baxter_core_msgs.msg import (
HeadPanCommand,
HeadState,
)
from baxter_interface import settings
class Head(object):
def __init__(self):
self.... | true | true |
f74757fd20c147065ba748cf72ebd3e20c4c94d2 | 4,907 | py | Python | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | 1 | 2015-12-18T21:46:55.000Z | 2015-12-18T21:46:55.000Z | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | null | null | null | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:03.000Z | 2021-03-21T11:37:03.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
# ... | 30.104294 | 78 | 0.58977 |
from heat.common import template_format
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import stack as parser
from heat.engine import template
from heat.tests import common
from heat.tests import ut... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.