hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7411fb58803e767faca0cd0bddcc3c8936903f4 | 3,666 | py | Python | app/user/tests/test_user_api.py | pnitin10/user-app-api | 264e45f4698e6099f737194f41b0593779ccb8b6 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | pnitin10/user-app-api | 264e45f4698e6099f737194f41b0593779ccb8b6 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | pnitin10/user-app-api | 264e45f4698e6099f737194f41b0593779ccb8b6 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
# TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**param... | 34.914286 | 79 | 0.63557 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
ME_URL = reverse('user:me')
def create_user(**params):
return get_user_model().obj... | true | true |
f7411fdf68289f86248cd68336b984faf9c3c880 | 14,098 | py | Python | tftest.py | 1n/terraform-python-testing-helper | 2552998a0a49d45724ea3533fae88925abb6d062 | [
"Apache-2.0"
] | null | null | null | tftest.py | 1n/terraform-python-testing-helper | 2552998a0a49d45724ea3533fae88925abb6d062 | [
"Apache-2.0"
] | null | null | null | tftest.py | 1n/terraform-python-testing-helper | 2552998a0a49d45724ea3533fae88925abb6d062 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.333333 | 117 | 0.686055 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import itertools
import json
import logging
import os
import shutil
import subprocess
import tempfile
import weakref
__version__ = '1.5... | true | true |
f741208b78753f7603d95f70a25ff3cd88f3334c | 1,592 | py | Python | src/bulk_producto2.py | cnavarreteliz/Datos-COVID19 | 4383c6a82f5ec41d55875daf6ce2d2ed71785aa4 | [
"MIT"
] | null | null | null | src/bulk_producto2.py | cnavarreteliz/Datos-COVID19 | 4383c6a82f5ec41d55875daf6ce2d2ed71785aa4 | [
"MIT"
] | null | null | null | src/bulk_producto2.py | cnavarreteliz/Datos-COVID19 | 4383c6a82f5ec41d55875daf6ce2d2ed71785aa4 | [
"MIT"
] | null | null | null | import pandas as pd
import glob
import re
df = []
for file in glob.glob("../output/producto2/*.csv"):
date = re.search("\d{4}-\d{2}-\d{2}", file).group(0).replace("-", "/")
fragment = pd.read_csv(file)
fragment["Fecha"] = date
df.append(fragment)
df = pd.concat(df)
# Reemplaza nombres de comuna, para... | 38.829268 | 139 | 0.679648 | import pandas as pd
import glob
import re
df = []
for file in glob.glob("../output/producto2/*.csv"):
date = re.search("\d{4}-\d{2}-\d{2}", file).group(0).replace("-", "/")
fragment = pd.read_csv(file)
fragment["Fecha"] = date
df.append(fragment)
df = pd.concat(df)
df["Comuna"] = df["Comuna"].replac... | true | true |
f741208bea5d73da7f6e6db42afb2ca0a0ba4bcb | 1,716 | py | Python | Packs/HealthCheck/Scripts/HealthCheckIncidentsCreatedDaily/HealthCheckIncidentsCreatedDaily.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HealthCheck/Scripts/HealthCheckIncidentsCreatedDaily/HealthCheckIncidentsCreatedDaily.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HealthCheck/Scripts/HealthCheckIncidentsCreatedDaily/HealthCheckIncidentsCreatedDaily.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
incident = demisto.incidents()[0]
accountName = incident.get('account')
accountName = f"acc_{accountName}/" if accountName != "" else ""
stats = demisto.executeCommand(
"demisto-api-post",
{
"uri": f"{accountNam... | 25.235294 | 106 | 0.463869 | import demistomock as demisto
from CommonServerPython import *
incident = demisto.incidents()[0]
accountName = incident.get('account')
accountName = f"acc_{accountName}/" if accountName != "" else ""
stats = demisto.executeCommand(
"demisto-api-post",
{
"uri": f"{accountName}statistics/widgets/que... | true | true |
f74120b6a5f87ef6b46dc3c4e4928e981b8ad973 | 112 | py | Python | snippets/instance_in_model.py | hit9/skylark | 5b7a14e401196e025117b095a7c5e68e551e547a | [
"BSD-2-Clause",
"MIT"
] | 114 | 2015-01-06T06:12:30.000Z | 2021-08-25T06:17:05.000Z | snippets/instance_in_model.py | keng-king/skylark | 5b7a14e401196e025117b095a7c5e68e551e547a | [
"BSD-2-Clause",
"MIT"
] | 10 | 2015-03-23T17:05:13.000Z | 2017-03-24T11:50:18.000Z | snippets/instance_in_model.py | keng-king/skylark | 5b7a14e401196e025117b095a7c5e68e551e547a | [
"BSD-2-Clause",
"MIT"
] | 59 | 2015-01-21T14:56:23.000Z | 2021-09-05T01:24:37.000Z | from models import User
user = User(name='jack')
if user in User:
print 'Some one in table is named jack'
| 16 | 43 | 0.696429 | from models import User
user = User(name='jack')
if user in User:
print 'Some one in table is named jack'
| false | true |
f74120e3590770dc7127ce09c3ee152068efc771 | 9,976 | py | Python | src/third_party/wiredtiger/test/suite/test_txn07.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_txn07.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | null | null | null | src/third_party/wiredtiger/test/suite/test_txn07.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... | 39.904 | 83 | 0.586407 |
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios
import wttest
class test_txn07(wttest.WiredTigerTestCase, suite_subprocess):
logmax = "100K"
tablename = 't... | false | true |
f741210e990fe912e6f404891bd75bfb8316c912 | 50,458 | py | Python | django/template/defaulttags.py | ChrisLiao-bupt/test | 48710c599f07da735aab7a9be54d6072553f46e4 | [
"MIT"
] | null | null | null | django/template/defaulttags.py | ChrisLiao-bupt/test | 48710c599f07da735aab7a9be54d6072553f46e4 | [
"MIT"
] | null | null | null | django/template/defaulttags.py | ChrisLiao-bupt/test | 48710c599f07da735aab7a9be54d6072553f46e4 | [
"MIT"
] | null | null | null | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import re
import sys
import warnings
from collections import namedtuple
from datetime import datetime
from itertools import cycle as itertools_cycle, groupby
from django.conf import settings
from django... | 33.796383 | 119 | 0.594534 | from __future__ import unicode_literals
import re
import sys
import warnings
from collections import namedtuple
from datetime import datetime
from itertools import cycle as itertools_cycle, groupby
from django.conf import settings
from django.utils import six, timezone
from django.utils.encoding import force_text
fro... | true | true |
f74121199df99d67cb1bc4527c9eaf51e9c35ddf | 35,821 | py | Python | NeurIPS_2021/Figure_1/DER_cubic/trainers/evidential_V2.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 11 | 2021-11-08T20:38:50.000Z | 2022-01-30T02:46:39.000Z | NeurIPS_2021/Figure_1/DER_cubic/trainers/evidential_V2.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2022-01-13T19:46:32.000Z | 2022-02-09T16:23:56.000Z | NeurIPS_2021/Figure_1/DER_cubic/trainers/evidential_V2.py | streeve/PI3NN | f7f08a195096e0388bb9230bc67c6acd6f41581a | [
"Apache-2.0"
] | 1 | 2021-12-17T18:38:26.000Z | 2021-12-17T18:38:26.000Z | import numpy as np
import tensorflow as tf
import time
import datetime
import os
import sys
import h5py
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import evidential_deep_learning as edl
from .util import normalize, gallery
class Evidential:
def __init__(self, model, opts, dataset... | 57.039809 | 197 | 0.57215 | import numpy as np
import tensorflow as tf
import time
import datetime
import os
import sys
import h5py
from pathlib import Path
import pandas as pd
import matplotlib.pyplot as plt
import evidential_deep_learning as edl
from .util import normalize, gallery
class Evidential:
def __init__(self, model, opts, dataset... | true | true |
f741211bb2f5d98a1d36dadc6247db4ea48d4d80 | 19,306 | py | Python | src/Models.py | SinaSafari/ml-models | 0c92090faee9143b3b7b37ae28401de2062d003d | [
"Apache-2.0"
] | 1 | 2021-08-15T05:57:09.000Z | 2021-08-15T05:57:09.000Z | src/Models.py | SinaSafari/ml-models | 0c92090faee9143b3b7b37ae28401de2062d003d | [
"Apache-2.0"
] | null | null | null | src/Models.py | SinaSafari/ml-models | 0c92090faee9143b3b7b37ae28401de2062d003d | [
"Apache-2.0"
] | null | null | null | import numpy as np
from collections import Counter
class BaseRegression():
"""
abstract class parent of linear and logistic regression
"""
def __init__(self, learning_rate=0.001, n_iters=1000):
self.lr = learning_rate
self.n_iters = n_iters
self.weights = None
self.bia... | 31.340909 | 91 | 0.584171 | import numpy as np
from collections import Counter
class BaseRegression():
"""
abstract class parent of linear and logistic regression
"""
def __init__(self, learning_rate=0.001, n_iters=1000):
self.lr = learning_rate
self.n_iters = n_iters
self.weights = None
self.bia... | false | true |
f74122343672fb7a04833b376127e1a333580103 | 531 | py | Python | objectset/__init__.py | rysdyk/django-objectset | cc3b6b1fe120d5bd61ffe5b42ea7b3d5457e949f | [
"BSD-2-Clause"
] | null | null | null | objectset/__init__.py | rysdyk/django-objectset | cc3b6b1fe120d5bd61ffe5b42ea7b3d5457e949f | [
"BSD-2-Clause"
] | null | null | null | objectset/__init__.py | rysdyk/django-objectset | cc3b6b1fe120d5bd61ffe5b42ea7b3d5457e949f | [
"BSD-2-Clause"
] | 3 | 2015-05-27T15:11:24.000Z | 2016-12-03T18:51:18.000Z | __version_info__ = {
'major': 0,
'minor': 2,
'micro': 5,
'releaselevel': 'beta',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
if __version_info__['releaselev... | 27.947368 | 73 | 0.591337 | __version_info__ = {
'major': 0,
'minor': 2,
'micro': 5,
'releaselevel': 'beta',
'serial': 1
}
def get_version(short=False):
assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final')
vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__]
if __version_info__['releaselev... | true | true |
f74122438eac8c27185a1e21f6a8dc2cc9dca269 | 3,088 | py | Python | utils.py | goberoi/face_experiments | 2fd23b902fd62ad1571bb2d537f1cf6977589534 | [
"MIT"
] | 54 | 2018-01-24T22:23:02.000Z | 2022-01-11T10:01:52.000Z | utils.py | AyushBherwani1998/sketch_face | 2fd23b902fd62ad1571bb2d537f1cf6977589534 | [
"MIT"
] | null | null | null | utils.py | AyushBherwani1998/sketch_face | 2fd23b902fd62ad1571bb2d537f1cf6977589534 | [
"MIT"
] | 15 | 2018-02-22T06:21:08.000Z | 2022-02-16T05:31:06.000Z | """Utilities for measuring frame rate, and reading frames in a separate thread.
This code was mostly taken from:
http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
"""
import cv2
import datetime
import time
from threading import Thread
class FPS:
"""Helper class to track numb... | 31.510204 | 109 | 0.640544 |
import cv2
import datetime
import time
from threading import Thread
class FPS:
def __init__(self):
self._start = None
self._end = None
self._numFrames = 0
self._last_update_time = time.time()
def start(self):
self._start = datetime.datetime... | true | true |
f74123038b8cac4b0c3398f66eec980bb714f7a3 | 838 | py | Python | evaluate.py | LichtungSq/2048-api | 5b7dd1f486cac0740720e7b1d284817bfc4bc39c | [
"Apache-2.0"
] | null | null | null | evaluate.py | LichtungSq/2048-api | 5b7dd1f486cac0740720e7b1d284817bfc4bc39c | [
"Apache-2.0"
] | null | null | null | evaluate.py | LichtungSq/2048-api | 5b7dd1f486cac0740720e7b1d284817bfc4bc39c | [
"Apache-2.0"
] | null | null | null | from game2048.game import Game
from game2048.displays import Display
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
# import timer
def single_run(size, score_to_win, AgentClass, **kwargs):
game = Game(size, score_to_win)
agent = AgentClass(game, display = Display(), **kwargs)
agent.play(verbose=True)
... | 27.032258 | 75 | 0.631265 | from game2048.game import Game
from game2048.displays import Display
import os
os.environ["CUDA_VISIBLE_DEVICES"]="1"
def single_run(size, score_to_win, AgentClass, **kwargs):
game = Game(size, score_to_win)
agent = AgentClass(game, display = Display(), **kwargs)
agent.play(verbose=True)
return game.s... | false | true |
f741234a05cba77dc77834fa7addcb1e920e0ef9 | 1,029 | py | Python | src/tox/session/commands/show_env.py | wvangeit/tox | d1984d1682e0c760e2170486e006793ced3b8ae8 | [
"MIT"
] | null | null | null | src/tox/session/commands/show_env.py | wvangeit/tox | d1984d1682e0c760e2170486e006793ced3b8ae8 | [
"MIT"
] | 10 | 2020-05-11T20:29:28.000Z | 2022-01-13T01:41:27.000Z | src/tox/session/commands/show_env.py | wvangeit/tox | d1984d1682e0c760e2170486e006793ced3b8ae8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from tox import reporter as report
def show_envs(config, all_envs=False, description=False):
env_conf = config.envconfigs # this contains all environments
default = config.envlist # this only the defaults
ignore = {config.isolated_build_env, conf... | 32.15625 | 81 | 0.632653 | from __future__ import absolute_import, unicode_literals
from tox import reporter as report
def show_envs(config, all_envs=False, description=False):
env_conf = config.envconfigs
default = config.envlist
ignore = {config.isolated_build_env, config.provision_tox_env}.union(default)
extra = [e for ... | true | true |
f74123f3d133416bf5d2155a9a17e41f1f5a04c7 | 44,210 | py | Python | tests/test_modeling_prophetnet.py | savindi-wijenayaka/transformer_old | 016960521eaaf5393c9fad1c4db15338455213f8 | [
"Apache-2.0"
] | 1 | 2022-02-22T18:38:35.000Z | 2022-02-22T18:38:35.000Z | tests/test_modeling_prophetnet.py | savindi-wijenayaka/transformer_old | 016960521eaaf5393c9fad1c4db15338455213f8 | [
"Apache-2.0"
] | 1 | 2021-03-21T03:28:23.000Z | 2021-03-21T06:06:39.000Z | tests/test_modeling_prophetnet.py | savindi-wijenayaka/transformer_old | 016960521eaaf5393c9fad1c4db15338455213f8 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team, The Microsoft Research team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 39.614695 | 695 | 0.656797 |
import copy
import tempfile
import unittest
from transformers import is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
if is_tor... | true | true |
f7412446cb6eb5874a37cff88689c35fb8b0ae11 | 12,390 | py | Python | bot_files/plugins/reddit.py | gorpoorko/Manicomio-Bot-GUI | e471381a3620d4fa1fa5562b5691a609cbafc9c4 | [
"FTL"
] | 1 | 2020-12-11T10:15:46.000Z | 2020-12-11T10:15:46.000Z | bot_files/plugins/reddit.py | gorpoorko/Manicomio-Bot-GUI | e471381a3620d4fa1fa5562b5691a609cbafc9c4 | [
"FTL"
] | null | null | null | bot_files/plugins/reddit.py | gorpoorko/Manicomio-Bot-GUI | e471381a3620d4fa1fa5562b5691a609cbafc9c4 | [
"FTL"
] | 1 | 2021-06-22T19:27:30.000Z | 2021-06-22T19:27:30.000Z | # -*- coding: utf-8 -*-
# ███╗ ███╗ █████╗ ███╗ ██╗██╗ ██████╗ ██████╗ ███╗ ███╗██╗ ██████╗
# ████╗ ████║██╔══██╗████╗ ██║██║██╔════╝██╔═══██╗████╗ ████║██║██╔═══██╗
# ██╔████╔██║███████║██╔██╗ ██║██║██║ ██║ ██║██╔████╔██║██║██║ ██║
# ██║╚██╔╝██║██╔══██║██║╚██╗██║██║██║ ██║ ██║██║╚██╔╝██║██║██║ █... | 60.439024 | 126 | 0.353511 |
import re
import aiohttp
from config import bot
import urllib
def treattitle(title):
title = title.replace("_", " ")
title = title.replace("[", "(")
title = title.replace("]", ")")
title = title.replace("(", "(")
title = title.replace(")", ")")
return title
async def reddit(msg)... | true | true |
f7412449c0da3cf4ec849c50b2664129b70ad433 | 38 | py | Python | configgen/generators/amiberry/__init__.py | batocera-linux/recalbox-configgen | b875d317b33129ce3f18342b1011f63c9b98bc80 | [
"MIT"
] | 2 | 2018-10-09T23:46:13.000Z | 2020-11-20T10:01:11.000Z | configgen/generators/amiberry/__init__.py | batocera-linux/_old_batocera-configgen_old | b875d317b33129ce3f18342b1011f63c9b98bc80 | [
"MIT"
] | 3 | 2018-01-12T12:10:39.000Z | 2018-02-19T20:32:29.000Z | configgen/generators/amiberry/__init__.py | batocera-linux/_old_batocera-configgen_old | b875d317b33129ce3f18342b1011f63c9b98bc80 | [
"MIT"
] | 4 | 2018-01-11T18:28:23.000Z | 2018-04-25T16:16:39.000Z | __author__ = 'Nicolas Adenis-Lamarre'
| 19 | 37 | 0.789474 | __author__ = 'Nicolas Adenis-Lamarre'
| true | true |
f741245fbaa8a2dd7773541b19013f3c7b7747ad | 2,393 | py | Python | trainer_table_generator.py | Blampharos/gym-order-randomiser | 0dbfd08bb5b2a0bc1fd42a3fd7917855e7b15d15 | [
"MIT"
] | null | null | null | trainer_table_generator.py | Blampharos/gym-order-randomiser | 0dbfd08bb5b2a0bc1fd42a3fd7917855e7b15d15 | [
"MIT"
] | null | null | null | trainer_table_generator.py | Blampharos/gym-order-randomiser | 0dbfd08bb5b2a0bc1fd42a3fd7917855e7b15d15 | [
"MIT"
] | 1 | 2021-06-01T17:02:51.000Z | 2021-06-01T17:02:51.000Z | #!/usr/bin/env python3
from pycparser import c_parser, c_ast, parse_file
from json import dump
from glob import glob
from re import sub
from string import digits
ast = parse_file("../pokeruby/src/data/trainer_parties.h")
#ast = parse_file("trainer_parties_trimmed.h")
#ast.show()
map_script_paths = glob('../pokeruby/... | 33.704225 | 80 | 0.688675 |
from pycparser import c_parser, c_ast, parse_file
from json import dump
from glob import glob
from re import sub
from string import digits
ast = parse_file("../pokeruby/src/data/trainer_parties.h")
map_script_paths = glob('../pokeruby/data/maps/*/scripts.inc')
map_scripts = []
for path in map_script_paths:
wi... | true | true |
f74124f9811c8e2f0ee1b354da22d90c6405cf3b | 327 | py | Python | ruleta/rule.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | ruleta/rule.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | ruleta/rule.py | Glinrens-corner/ruleta | e49f5701170d97366a47378229ade449ed729402 | [
"MIT"
] | null | null | null | from ruleta.exceptions import NoActionException
from collections import namedtuple
class Rule(namedtuple("Rule", ["if_", "then_"]) ):
__slots__ = []
def __call__(self, input_):
if ( self.if_(input_)):
return self.then_(input_)
else:
raise NoActionException()
... | 19.235294 | 50 | 0.602446 | from ruleta.exceptions import NoActionException
from collections import namedtuple
class Rule(namedtuple("Rule", ["if_", "then_"]) ):
__slots__ = []
def __call__(self, input_):
if ( self.if_(input_)):
return self.then_(input_)
else:
raise NoActionException()
... | true | true |
f741260a064892cf08393ba45c4146dffc0ffffc | 1,132 | py | Python | agent.py | adityasaxena26/OpenAI-Gym-Taxi-v2-Task | e6061b39134c511de47b490f034317466c3c892e | [
"MIT"
] | null | null | null | agent.py | adityasaxena26/OpenAI-Gym-Taxi-v2-Task | e6061b39134c511de47b490f034317466c3c892e | [
"MIT"
] | null | null | null | agent.py | adityasaxena26/OpenAI-Gym-Taxi-v2-Task | e6061b39134c511de47b490f034317466c3c892e | [
"MIT"
] | null | null | null | import numpy as np
from collections import defaultdict
class Agent:
def __init__(self, nA=6):
"""
Initialize agent.
Params
======
nA: number of actions available to the agent
"""
self.nA = nA
self.Q = defaultdict(lambda: np.zeros(self.nA))
def ... | 25.727273 | 76 | 0.575972 | import numpy as np
from collections import defaultdict
class Agent:
def __init__(self, nA=6):
self.nA = nA
self.Q = defaultdict(lambda: np.zeros(self.nA))
def select_action(self, state):
return np.random.choice(self.nA)
def step(self, state, action, reward, next_state, done):
... | true | true |
f741262f8ec2be68d44e078d2c3fc3b53116b370 | 643 | py | Python | polyaxon/stats/__init__.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | polyaxon/stats/__init__.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | polyaxon/stats/__init__.py | gzcf/polyaxon | 77ac8838c6444a36541e6c28aba7ae42de392fee | [
"MIT"
] | null | null | null | from django.conf import settings
from libs.services import LazyServiceWrapper
from stats.base import BaseStatsBackend
def get_stats_backend():
if settings.STATS_BACKEND == settings.STATS_BACKEND_NOOP:
return 'stats.noop.NoOpStatsBackend'
if settings.STATS_BACKEND == settings.STATS_BACKEND_DATADOG:
... | 27.956522 | 64 | 0.765163 | from django.conf import settings
from libs.services import LazyServiceWrapper
from stats.base import BaseStatsBackend
def get_stats_backend():
if settings.STATS_BACKEND == settings.STATS_BACKEND_NOOP:
return 'stats.noop.NoOpStatsBackend'
if settings.STATS_BACKEND == settings.STATS_BACKEND_DATADOG:
... | true | true |
f74126be16cc2833e8c99970fac16ae21211bab2 | 4,669 | py | Python | pro/shangmi/serializer_helpers.py | jaxsbin/shangmi | 304edaf77d4dcebed4dcac2e7e4841c26ed2d0af | [
"Apache-2.0"
] | 1 | 2018-10-24T09:48:41.000Z | 2018-10-24T09:48:41.000Z | pro/shangmi/serializer_helpers.py | jaxsbin/shangmi | 304edaf77d4dcebed4dcac2e7e4841c26ed2d0af | [
"Apache-2.0"
] | null | null | null | pro/shangmi/serializer_helpers.py | jaxsbin/shangmi | 304edaf77d4dcebed4dcac2e7e4841c26ed2d0af | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import collections
from collections import OrderedDict
from django.utils.encoding import force_text
class ReturnDict(OrderedDict):
"""
Return object from `serializer.data` for the `Serializer` class.
Includes a backlink to the serializer instance for renderers
... | 29.18125 | 77 | 0.631827 | from __future__ import unicode_literals
import collections
from collections import OrderedDict
from django.utils.encoding import force_text
class ReturnDict(OrderedDict):
def __init__(self, *args, **kwargs):
self.serializer = kwargs.pop('serializer')
super(ReturnDict, self).__init__(*args, **k... | true | true |
f741277d92f247216451cb334687254ee6806d11 | 1,764 | py | Python | test/emitter.test.py | thongdong7/socket.io-python-emitter | 13e794606b3c538899ca8bc4d463c7316e94e174 | [
"MIT"
] | null | null | null | test/emitter.test.py | thongdong7/socket.io-python-emitter | 13e794606b3c538899ca8bc4d463c7316e94e174 | [
"MIT"
] | null | null | null | test/emitter.test.py | thongdong7/socket.io-python-emitter | 13e794606b3c538899ca8bc4d463c7316e94e174 | [
"MIT"
] | null | null | null | __author__ = 'ziyasal'
from unittest import TestCase
import subprocess
import redis
from emitter import Emitter
class TestEmitter(TestCase):
@classmethod
def setUpClass(cls):
cls.redis_server = subprocess.Popen("redis-server", stdout=subprocess.PIPE, shell=True)
def setUp(self):
self.... | 27.138462 | 116 | 0.617347 | __author__ = 'ziyasal'
from unittest import TestCase
import subprocess
import redis
from emitter import Emitter
class TestEmitter(TestCase):
@classmethod
def setUpClass(cls):
cls.redis_server = subprocess.Popen("redis-server", stdout=subprocess.PIPE, shell=True)
def setUp(self):
self.... | true | true |
f741279159c0358e1b07ed17ba8d847b83c74c51 | 1,152 | py | Python | var/spack/repos/builtin/packages/mosh/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/mosh/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/mosh/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mosh(AutotoolsPackage):
"""Remote terminal application that allows roaming, supports inter... | 36 | 95 | 0.739583 |
from spack import *
class Mosh(AutotoolsPackage):
homepage = "https://mosh.org/"
url = "https://mosh.org/mosh-1.2.6.tar.gz"
version('1.3.2', sha256='da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216')
version('1.3.0', sha256='320e12f461e55d71566597976bd9440ba6c5265fa68fbf614... | true | true |
f741286cfa52825b39a20e5b50e2b3fbd5be91d3 | 12,111 | py | Python | lib/mysqlx/protobuf/mysqlx_pb2.py | nmariz/mysql-connector-python | 2ce54eabb3862b3429febffaa0e9e3827601304b | [
"Artistic-1.0-Perl"
] | 3 | 2020-03-16T02:49:59.000Z | 2022-03-21T15:04:44.000Z | lib/mysqlx/protobuf/mysqlx_pb2.py | nmariz/mysql-connector-python | 2ce54eabb3862b3429febffaa0e9e3827601304b | [
"Artistic-1.0-Perl"
] | 1 | 2020-12-10T08:04:25.000Z | 2020-12-10T08:04:25.000Z | lib/mysqlx/protobuf/mysqlx_pb2.py | nmariz/mysql-connector-python | 2ce54eabb3862b3429febffaa0e9e3827601304b | [
"Artistic-1.0-Perl"
] | 2 | 2020-05-01T08:16:25.000Z | 2020-07-21T00:12:06.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mysqlx.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 google.protobuf import reflection as _reflec... | 32.469169 | 1,693 | 0.721988 |
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 |
f7412936434132683d6db3a406f13310f72bbacf | 345 | py | Python | py/place/lattice2.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | py/place/lattice2.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | py/place/lattice2.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import Tkinter as Tk
root=Tk.Tk()
Tk.Button(root,
text="ABC",
).grid(row=0, column=0)
Tk.Button(root,
text="ABC\nabc",
).grid(row=0, column=1)
Tk.Button(root,
text="ABCABC\nABCABC",
).grid(row=1, column=0)
Tk.Button(root,
text="ABCABC",
).grid(row=1, co... | 15 | 32 | 0.594203 |
import Tkinter as Tk
root=Tk.Tk()
Tk.Button(root,
text="ABC",
).grid(row=0, column=0)
Tk.Button(root,
text="ABC\nabc",
).grid(row=0, column=1)
Tk.Button(root,
text="ABCABC\nABCABC",
).grid(row=1, column=0)
Tk.Button(root,
text="ABCABC",
).grid(row=1, column=1)
root.mainloo... | true | true |
f7412a11d01e819fd382497e5a7239ff19dc2b3d | 1,541 | py | Python | starbursts/plots/mpl.SFEoscil.py | astrobeard/VICEdev | c78804ec63b48a760ce3e50b8d3afc7b699ec75f | [
"MIT"
] | null | null | null | starbursts/plots/mpl.SFEoscil.py | astrobeard/VICEdev | c78804ec63b48a760ce3e50b8d3afc7b699ec75f | [
"MIT"
] | null | null | null | starbursts/plots/mpl.SFEoscil.py | astrobeard/VICEdev | c78804ec63b48a760ce3e50b8d3afc7b699ec75f | [
"MIT"
] | null | null | null |
import visuals
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import vice
import sys
import warnings
warnings.filterwarnings("ignore")
if __name__ == "__main__":
axes = visuals.subplots(1, 3, figsize = (21, 7))
axes.insert(1, visuals.append_subplot_below(axes[0]))
axes[0... | 33.5 | 71 | 0.683323 |
import visuals
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import vice
import sys
import warnings
warnings.filterwarnings("ignore")
if __name__ == "__main__":
axes = visuals.subplots(1, 3, figsize = (21, 7))
axes.insert(1, visuals.append_subplot_below(axes[0]))
axes[0... | true | true |
f7412a23c26f2fc2be1462553a9744f28259907f | 1,317 | py | Python | Dashboard with Django/app/migrations/0004_auto_20180518_1257.py | reddyprasade/Data-Analysis-with-Python- | 2440e23486856eea5556c8262467b3a618032bc2 | [
"MIT"
] | 1 | 2021-06-29T23:15:05.000Z | 2021-06-29T23:15:05.000Z | Dashboard with Django/app/migrations/0004_auto_20180518_1257.py | reddyprasade/Data-Analysis-with-Python- | 2440e23486856eea5556c8262467b3a618032bc2 | [
"MIT"
] | null | null | null | Dashboard with Django/app/migrations/0004_auto_20180518_1257.py | reddyprasade/Data-Analysis-with-Python- | 2440e23486856eea5556c8262467b3a618032bc2 | [
"MIT"
] | 1 | 2021-12-20T10:04:53.000Z | 2021-12-20T10:04:53.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-05-18 07:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20180518_1221'),
]
operations = [
migrations.CreateModel(
... | 36.583333 | 114 | 0.58694 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20180518_1221'),
]
operations = [
migrations.CreateModel(
name='crimes_against_women',
fields=[
... | true | true |
f7412a571fe5ab280392cae51178480f1541cac3 | 3,644 | py | Python | common-python/rest_wrappers/oc/oc/delete_ip_association.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 28 | 2016-11-07T14:03:25.000Z | 2022-02-01T08:46:52.000Z | common-python/rest_wrappers/oc/oc/delete_ip_association.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 3 | 2016-11-09T13:23:03.000Z | 2018-04-05T15:49:22.000Z | common-python/rest_wrappers/oc/oc/delete_ip_association.py | LaudateCorpus1/atg-commerce-iaas | f1ae31657fc0111a5c019d46a28a3c81aae1acb2 | [
"MIT"
] | 13 | 2016-10-27T17:59:38.000Z | 2022-02-18T04:38:38.000Z | #!/usr/bin/python
# Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (... | 31.413793 | 115 | 0.612514 |
__author__ = "Andrew Hopkinson (Oracle Cloud Solutions A-Team)"
__copyright__ = "Copyright (c) 2013, 2014-2017 Oracle and/or its affiliates. All rights reserved."
__ekitversion__ = "@VERSION@"
__ekitrelease__ = "@RELEASE@"
__version__ = "1.0.0.0"
__date__ = "@BUILDDATE@"
__status__ = "Development"
__module__ = "de... | true | true |
f7412a5a7f73e47ba450bf6080b7eb7f44446fa9 | 35,604 | py | Python | CutPlanner.py | frogmaster/meerk40t | 9288b71c05670acf47976b18b2d6bf9d6c58ba99 | [
"MIT"
] | null | null | null | CutPlanner.py | frogmaster/meerk40t | 9288b71c05670acf47976b18b2d6bf9d6c58ba99 | [
"MIT"
] | null | null | null | CutPlanner.py | frogmaster/meerk40t | 9288b71c05670acf47976b18b2d6bf9d6c58ba99 | [
"MIT"
] | null | null | null | from svgelements import *
class CutPlanner:
@staticmethod
def bounding_box(elements):
if isinstance(elements, SVGElement):
elements = [elements]
elif isinstance(elements, list):
try:
elements = [e.object for e in elements if isinstance(e.obje... | 34.97446 | 119 | 0.50587 | from svgelements import *
class CutPlanner:
@staticmethod
def bounding_box(elements):
if isinstance(elements, SVGElement):
elements = [elements]
elif isinstance(elements, list):
try:
elements = [e.object for e in elements if isinstance(e.obje... | true | true |
f7412ab4117cda35749acbdde76ae6ae3767d0e0 | 77 | py | Python | Python/Unsorted/318a.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | Python/Unsorted/318a.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | Python/Unsorted/318a.py | LittleEndu/Codeforces | 82c49b10702c58bc5ce062801d740a2f5f600062 | [
"MIT"
] | null | null | null | # Shortest
a,b=map(int,input().split());c=b-(a+1)//2;print([b*2-1,c*2][c>0]) | 25.666667 | 65 | 0.558442 |
a,b=map(int,input().split());c=b-(a+1)//2;print([b*2-1,c*2][c>0]) | true | true |
f7412b01058d3f0a4f9c7ac716c5f428decb1e83 | 12,483 | py | Python | qa/rpc-tests/p2p-acceptblock.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | 1 | 2019-04-08T01:45:23.000Z | 2019-04-08T01:45:23.000Z | qa/rpc-tests/p2p-acceptblock.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-acceptblock.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | 1 | 2019-04-15T03:48:50.000Z | 2019-04-15T03:48:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | 42.604096 | 107 | 0.651206 |
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
from test_framework.blocktools import create_block, create_coinbase
class TestNode(NodeConnCB):
def __init__(self):
NodeConnCB.__init__(self)
se... | true | true |
f7412b220fbb2410fe7e8d495c082347924712f0 | 7,276 | py | Python | flatland/envs/distance_map.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | 1 | 2021-04-27T12:31:07.000Z | 2021-04-27T12:31:07.000Z | flatland/envs/distance_map.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | null | null | null | flatland/envs/distance_map.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | null | null | null | from collections import deque
from typing import List, Optional
import numpy as np
from flatland.core.grid.grid4_utils import get_new_position
from flatland.core.transition_map import GridTransitionMap
from flatland.envs.agent_utils import EnvAgent
class DistanceMap:
def __init__(self, agents: List[E... | 45.192547 | 121 | 0.592908 | from collections import deque
from typing import List, Optional
import numpy as np
from flatland.core.grid.grid4_utils import get_new_position
from flatland.core.transition_map import GridTransitionMap
from flatland.envs.agent_utils import EnvAgent
class DistanceMap:
def __init__(self, agents: List[E... | true | true |
f7412c2dd37b8fde9068ac9fef2a8fe95929f0c6 | 4,624 | py | Python | examples/protocols/sockets/tcp_client/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 8,747 | 2016-08-18T14:58:24.000Z | 2022-03-31T20:58:55.000Z | examples/protocols/sockets/tcp_client/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 8,603 | 2016-08-20T08:55:56.000Z | 2022-03-31T23:04:01.000Z | examples/protocols/sockets/tcp_client/example_test.py | cablelabs/esp-idf | a8f9a65f251a33cd5a5deaf14e95ca417abad41b | [
"Apache-2.0"
] | 6,380 | 2016-08-18T18:17:00.000Z | 2022-03-31T22:25:57.000Z | # This example code is in the Public Domain (or CC0 licensed, at your option.)
# Unless required by applicable law or agreed to in writing, this
# software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied.
# -*- coding: utf-8 -*-
from __future__ import pri... | 35.030303 | 123 | 0.614619 |
from __future__ import print_function, unicode_literals
import os
import re
import socket
import sys
from builtins import input
from threading import Event, Thread
import netifaces
import ttfw_idf
PORT = 3333
INTERFACE = 'eth0'
def get_my_ip(type):
for i in netifaces.ifaddresses(INTERFACE)[type]:
... | true | true |
f7412d10302dc195f5566319ef57207d09bad3b3 | 5,802 | py | Python | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/bitbucket_oauth2/tests.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 6,342 | 2015-01-01T07:40:30.000Z | 2022-03-31T04:18:30.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/bitbucket_oauth2/tests.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,198 | 2015-01-02T15:17:45.000Z | 2022-03-28T10:20:43.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/bitbucket_oauth2/tests.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,928 | 2015-01-01T10:44:13.000Z | 2022-03-31T03:20:16.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import mock
from django.test.utils import override_settings
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers import registry
from allauth.socialaccount.tests import create_oauth2_tests
from allaut... | 36.955414 | 129 | 0.510686 |
from __future__ import unicode_literals
from unittest import mock
from django.test.utils import override_settings
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers import registry
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedRe... | true | true |
f7412e2f270169d30451207b48b6f20c5ce468ff | 701 | py | Python | app/lecture06-styles/font.py | vahidfzm/python-and-excel-course-code | 1c975c61d97d7bebb13622362011f68943f954e9 | [
"MIT"
] | 2 | 2021-06-19T08:08:20.000Z | 2021-06-30T13:46:04.000Z | app/lecture06-styles/font.py | vahidfzm/python-and-excel-course-code | 1c975c61d97d7bebb13622362011f68943f954e9 | [
"MIT"
] | null | null | null | app/lecture06-styles/font.py | vahidfzm/python-and-excel-course-code | 1c975c61d97d7bebb13622362011f68943f954e9 | [
"MIT"
] | null | null | null | ###############################################################
################# https://www.fardanesh.ir ####################
###############################################################
from openpyxl import load_workbook
from openpyxl.styles import Font
wb=load_workbook('lecture06-styles/list1.xlsx')
ws1=wb.... | 21.90625 | 63 | 0.430813 | true | true | |
f7412fdc8e9db23924f3d74f806dd17170976acc | 1,006 | py | Python | app/validators/v1/order_forms.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | 1 | 2020-02-03T18:39:33.000Z | 2020-02-03T18:39:33.000Z | app/validators/v1/order_forms.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | null | null | null | app/validators/v1/order_forms.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | null | null | null | from flask import request
from lin.exception import ParameterException
from lin.forms import Form
from wtforms import Form as WTForm, IntegerField
from wtforms.validators import DataRequired, NumberRange, AnyOf
class OneProductOfOrder(WTForm):
product_id = IntegerField(validators=[DataRequired(message='商品ID不能为空')... | 35.928571 | 88 | 0.659046 | from flask import request
from lin.exception import ParameterException
from lin.forms import Form
from wtforms import Form as WTForm, IntegerField
from wtforms.validators import DataRequired, NumberRange, AnyOf
class OneProductOfOrder(WTForm):
product_id = IntegerField(validators=[DataRequired(message='商品ID不能为空')... | true | true |
f74130593d62d948df1657ffb1e7184bcb2446c0 | 196 | py | Python | python_ghost_cursor/playwright_sync/_mouse_helper.py | mcolella14/python_ghost_cursor | eb2188d75bbef8a01cde209d66ab9a4cac433b98 | [
"MIT"
] | 7 | 2021-11-08T23:25:34.000Z | 2021-12-27T12:17:18.000Z | python_ghost_cursor/playwright_sync/_mouse_helper.py | mcolella14/pyppeteer_ghost_cursor | eb2188d75bbef8a01cde209d66ab9a4cac433b98 | [
"MIT"
] | 2 | 2021-06-19T12:50:57.000Z | 2021-06-30T09:54:45.000Z | python_ghost_cursor/playwright_sync/_mouse_helper.py | mcolella14/python_ghost_cursor | eb2188d75bbef8a01cde209d66ab9a4cac433b98 | [
"MIT"
] | 2 | 2021-05-27T10:45:27.000Z | 2021-05-27T10:50:36.000Z | from playwright.sync_api import Page
from pathlib import Path
def install_mouse_helper(page: Page) -> None:
page.add_init_script(path=Path(__file__).parent.joinpath("../js/mouseHelper.js"))
| 28 | 85 | 0.77551 | from playwright.sync_api import Page
from pathlib import Path
def install_mouse_helper(page: Page) -> None:
page.add_init_script(path=Path(__file__).parent.joinpath("../js/mouseHelper.js"))
| true | true |
f741310e2114e1269517eb16daff889e0c8f4e2e | 944 | py | Python | cryptotest.py | BoeJaker/JARVIS | 6fdef2fac80fa38933dba275b3456e06f483e656 | [
"Apache-2.0"
] | null | null | null | cryptotest.py | BoeJaker/JARVIS | 6fdef2fac80fa38933dba275b3456e06f483e656 | [
"Apache-2.0"
] | null | null | null | cryptotest.py | BoeJaker/JARVIS | 6fdef2fac80fa38933dba275b3456e06f483e656 | [
"Apache-2.0"
] | null | null | null | import ccxt
class crypto(object):
watchlist = {"BTC":"", "ETH":"", "EOS":"", "ADA":"", "IOTA":"", "NULS":"", "NEO":"", "SKY":"", "PAL":""}
def __init__(self):
self.build_market()
def list_exchanges(self):
n = [print(x) for x in ccxt.exchanges]
def build_market(self):
self.binance = ccxt.binance()
self.c... | 23.02439 | 105 | 0.647246 | import ccxt
class crypto(object):
watchlist = {"BTC":"", "ETH":"", "EOS":"", "ADA":"", "IOTA":"", "NULS":"", "NEO":"", "SKY":"", "PAL":""}
def __init__(self):
self.build_market()
def list_exchanges(self):
n = [print(x) for x in ccxt.exchanges]
def build_market(self):
self.binance = ccxt.binance()
self.c... | true | true |
f7413134398bc969b47fb6a2fb8bfb14d3e3ca48 | 94 | py | Python | myParams.py | giladddd/MLN | 52876e75671d3fee8905b16931aadc9ecdc7bd4f | [
"MIT"
] | 2 | 2019-04-16T05:04:23.000Z | 2020-05-20T15:31:19.000Z | myParams.py | giladddd/MLN | 52876e75671d3fee8905b16931aadc9ecdc7bd4f | [
"MIT"
] | null | null | null | myParams.py | giladddd/MLN | 52876e75671d3fee8905b16931aadc9ecdc7bd4f | [
"MIT"
] | 2 | 2018-12-30T14:16:02.000Z | 2019-08-06T16:43:46.000Z | # myParams.py
def init():
global myList
global myDict
myList = []
myDict = {} | 13.428571 | 17 | 0.56383 |
def init():
global myList
global myDict
myList = []
myDict = {} | true | true |
f741313b46c2030440d04c34d219d852a2a82311 | 1,597 | py | Python | _old/interface/bar.py | mccartnm/spaceman | 6f6f668c46531c68b87b0aaa16fb3f616375ed7d | [
"MIT"
] | 1 | 2019-05-12T23:33:19.000Z | 2019-05-12T23:33:19.000Z | _old/interface/bar.py | mccartnm/spaceman | 6f6f668c46531c68b87b0aaa16fb3f616375ed7d | [
"MIT"
] | null | null | null | _old/interface/bar.py | mccartnm/spaceman | 6f6f668c46531c68b87b0aaa16fb3f616375ed7d | [
"MIT"
] | null | null | null | """
Progress bars, health bars, etc
"""
import arcade
from ..core.utils import Rect, Position
from .iabstract import _AbstractInterfaceObject
class Bar(_AbstractInterfaceObject):
"""
Drawable bar
"""
MIDDLE_OUT = 'mi'
RIGHT_TO_LEFT = 'rtl'
def __init__(self,
geometry: Rect... | 21.876712 | 62 | 0.547276 |
import arcade
from ..core.utils import Rect, Position
from .iabstract import _AbstractInterfaceObject
class Bar(_AbstractInterfaceObject):
MIDDLE_OUT = 'mi'
RIGHT_TO_LEFT = 'rtl'
def __init__(self,
geometry: Rect = Rect(),
color = arcade.color.BLUE,
p... | true | true |
f7413153eb991e962c90cc4cfae59300d84da55a | 14,578 | bzl | Python | source/extensions/extensions_build_config.bzl | Monkeyanator/envoy-wasm | a7a2318fdfb3cff4f90cb79edf5de834e8d3b24d | [
"Apache-2.0"
] | null | null | null | source/extensions/extensions_build_config.bzl | Monkeyanator/envoy-wasm | a7a2318fdfb3cff4f90cb79edf5de834e8d3b24d | [
"Apache-2.0"
] | null | null | null | source/extensions/extensions_build_config.bzl | Monkeyanator/envoy-wasm | a7a2318fdfb3cff4f90cb79edf5de834e8d3b24d | [
"Apache-2.0"
] | null | null | null | # See bazel/README.md for details on how this system works.
EXTENSIONS = {
#
# Access loggers
#
"envoy.access_loggers.file": "//source/extensions/access_loggers/file:config",
"envoy.access_loggers.http_grpc": "//source/extensions/access_loggers/http_grpc:con... | 59.99177 | 132 | 0.633626 |
EXTENSIONS = {
"envoy.access_loggers.file": "//source/extensions/access_loggers/file:config",
"envoy.access_loggers.http_grpc": "//source/extensions/access_loggers/http_grpc:config",
"envoy.access_loggers.wasm": "//source/exten... | true | true |
f7413192fc5522cc662032a7134b7700ac49edd1 | 1,603 | py | Python | logistic_regression/logistic_regression.py | ryanirl/ml-basics | e143eacf6338877d8111d1c0ee56853475efa914 | [
"MIT"
] | null | null | null | logistic_regression/logistic_regression.py | ryanirl/ml-basics | e143eacf6338877d8111d1c0ee56853475efa914 | [
"MIT"
] | null | null | null | logistic_regression/logistic_regression.py | ryanirl/ml-basics | e143eacf6338877d8111d1c0ee56853475efa914 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
### --- Gather Dataset --- ###
n = 100
X, y = make_blobs(n_samples = n, centers = 2)
y = y[:, np.newaxis]
### --- Build Model --- ###
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
class LogisticRegression:
def ... | 21.662162 | 95 | 0.537742 | import numpy as np
from sklearn.datasets import make_blobs
import matplotlib.pyplot as plt
:, np.newaxis]
lass LogisticRegression:
def predict(self, X, w, b):
return sigmoid(X.dot(w) + b)
def loss(self, pred, y):
BCE = (y * np.log(pred + 1e-6) + (1 - y) * np.log(1 - pred + 1e-6))
r... | true | true |
f74131f2be5a1955c0e90e47083a2e5dc843720e | 1,913 | py | Python | benchmark/startPyquil3243.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil3243.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil3243.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=42
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(3) # number=31
prog... | 25.171053 | 64 | 0.558808 |
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(3)
prog += CZ(0,3)
prog += H(3)
prog += H(3)
prog +... | true | true |
f741324487eae70eadbe239c0c4430cff4ac3a21 | 413 | py | Python | server/fullstackChallenge/wsgi.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | null | null | null | server/fullstackChallenge/wsgi.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | 7 | 2020-09-07T18:44:00.000Z | 2022-02-10T19:05:41.000Z | server/fullstackChallenge/wsgi.py | thiagobrez/newsWebsite | 130f01d29dd776eaa096080982274bb27d19ad8f | [
"MIT"
] | null | null | null | """
WSGI config for fullstackChallenge project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('D... | 24.294118 | 78 | 0.79661 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fullstackChallenge.settings')
application = get_wsgi_application()
| true | true |
f74132a29f89965391c63f5009e8d00637873393 | 1,326 | py | Python | efinance/bond/config.py | mpquant/efinance | d80406c2d9cb3d84f9d1ed792a2b574ee1692f6e | [
"MIT"
] | 2 | 2021-08-15T09:56:07.000Z | 2021-09-13T16:09:09.000Z | efinance/bond/config.py | pmlzzz/efinance | 3ab373e609459580c8a462b6bfe580780c4c4908 | [
"MIT"
] | null | null | null | efinance/bond/config.py | pmlzzz/efinance | 3ab373e609459580c8a462b6bfe580780c4c4908 | [
"MIT"
] | 3 | 2021-08-11T13:26:01.000Z | 2021-09-18T06:08:57.000Z | from pathlib import Path
HERE = Path(__file__).parent
# K 线表头
EASTMONEY_KLINE_FIELDS = {
'f51': '日期',
'f52': '开盘',
'f53': '收盘',
'f54': '最高',
'f55': '最低',
'f56': '成交量',
'f57': '成交额',
'f58': '振幅',
'f59': '涨跌幅',
'f60': '涨跌额',
'f61': '换手率',
}
# 请求头
EASTMONEY_REQUEST_HEADERS = {
... | 22.474576 | 96 | 0.533183 | from pathlib import Path
HERE = Path(__file__).parent
EASTMONEY_KLINE_FIELDS = {
'f51': '日期',
'f52': '开盘',
'f53': '收盘',
'f54': '最高',
'f55': '最低',
'f56': '成交量',
'f57': '成交额',
'f58': '振幅',
'f59': '涨跌幅',
'f60': '涨跌额',
'f61': '换手率',
}
EASTMONEY_REQUEST_HEADERS = {
'User-Ag... | true | true |
f74132a4d2b275e2f4d96d890caf246e49d2fb62 | 10,023 | py | Python | spektral/layers/convolutional/gat_conv.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | spektral/layers/convolutional/gat_conv.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | spektral/layers/convolutional/gat_conv.py | colliner/spektral | b776200fd1fa820f05b559f0c1c6265e0eca4894 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import initializers, regularizers, constraints
from tensorflow.keras.layers import Dropout
from spektral.layers import ops
from spektral.layers.convolutional.conv import Conv
from spektral.layers.ops import modes
class GATConv(Co... | 40.092 | 92 | 0.625062 | import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras import initializers, regularizers, constraints
from tensorflow.keras.layers import Dropout
from spektral.layers import ops
from spektral.layers.convolutional.conv import Conv
from spektral.layers.ops import modes
class GATConv(Co... | true | true |
f7413388e8c069558219e983af62e4c003c68214 | 2,340 | py | Python | Tests/test_clrload2.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | null | null | null | Tests/test_clrload2.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | null | null | null | Tests/test_clrload2.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | 1 | 2019-09-18T05:37:46.000Z | 2019-09-18T05:37:46.000Z | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | 34.411765 | 101 | 0.605556 | true | true | |
f74133e7aba4bf1a8913a53a97778f1bdd9e6601 | 10,227 | py | Python | tensorflow_datasets/scripts/documentation/document_datasets.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/scripts/documentation/document_datasets.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/scripts/documentation/document_datasets.py | jvishnuvardhan/datasets | b8e38187058f1221e67c6291b3f29385ebb35fa2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 32.26183 | 114 | 0.735406 |
import collections
from concurrent import futures
import dataclasses
import functools
from typing import Any, Dict, Iterator, List, Optional, Type
from absl import logging
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow_datasets.scripts.documentation import dataset_markdown_b... | true | true |
f741340ad3602cf9f8eb9eaf075bc9edd5cf5719 | 5,194 | py | Python | rlpy/gradnet/samples/single_agent/tank_target_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | rlpy/gradnet/samples/single_agent/tank_target_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | rlpy/gradnet/samples/single_agent/tank_target_env.py | imandr/RLpy | f01cf7af47b6054e4e52d663ceafc463df6f6166 | [
"BSD-3-Clause"
] | null | null | null | import random
import numpy as np
import math, time
from gym import spaces
from draw2d import Viewer, Frame, Line, Polygon, Circle, Text
class TankTargetEnv(object):
FireRange = 0.1
Speed = 0.02
RotSpeed = math.pi*2/50
Width = 0.01
TimeHorizon = 100
GasReward = 0.0
IdleReward = 0.0
... | 30.552941 | 120 | 0.507124 | import random
import numpy as np
import math, time
from gym import spaces
from draw2d import Viewer, Frame, Line, Polygon, Circle, Text
class TankTargetEnv(object):
FireRange = 0.1
Speed = 0.02
RotSpeed = math.pi*2/50
Width = 0.01
TimeHorizon = 100
GasReward = 0.0
IdleReward = 0.0
... | true | true |
f741347e1a45aaccb758384ade1a12d063e93831 | 6,867 | py | Python | bokeh/application/handlers/code.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | bokeh/application/handlers/code.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | bokeh/application/handlers/code.py | kevin1kevin1k/bokeh | 9f34b5b710e2748ec803c12918ec1706098a3477 | [
"BSD-3-Clause"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 31.5 | 117 | 0.49352 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
import os
import sys
from ...io.doc import set_curdoc, curdoc
from .code_runner import CodeRunner
from .handler import Handler
__all__ = (
'CodeHandler',
)
... | true | true |
f7413718d83bd49324a666e6c439e369bf061f7e | 783 | py | Python | dynts/lib/fallback/maths.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 57 | 2015-02-10T13:42:06.000Z | 2022-03-28T14:48:36.000Z | dynts/lib/fallback/maths.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 1 | 2016-11-01T07:43:05.000Z | 2016-11-01T07:43:05.000Z | dynts/lib/fallback/maths.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 17 | 2015-05-08T04:09:19.000Z | 2021-08-02T19:24:52.000Z |
def bindata(data, maxbins = 30, reduction = 0.1):
'''
data must be numeric list with a len above 20
This function counts the number of data points in a reduced array
'''
tole = 0.01
N = len(data)
assert N > 20
vmin = min(data)
vmax = max(data)
DV = vmax - vmin
tol = tole*DV
vmax +=... | 23.727273 | 65 | 0.532567 |
def bindata(data, maxbins = 30, reduction = 0.1):
tole = 0.01
N = len(data)
assert N > 20
vmin = min(data)
vmax = max(data)
DV = vmax - vmin
tol = tole*DV
vmax += tol
if vmin >= 0:
vmin -= tol
vmin = max(0.0,vmin)
else:
vmin -= tol
n = min(maxbins,ma... | true | true |
f741371cb89b0dec926cf4c72edc8d82829f9ebd | 3,049 | py | Python | sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/setup.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/setup.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/setup.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 33.505495 | 91 | 0.608068 |
import re
import os.path
from io import open
from setuptools import find_packages, setup
PACKAGE_NAME = "azure-mgmt-hybridkubernetes"
PACKAGE_PPRINT_NAME = "HybridKubernetes Management"
package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
try:
import a... | true | true |
f7413909ddf82204b8539d01f5a5db72be3a4813 | 684 | py | Python | init.py | kdkvcm/Py_Snake_Game | 96c7a6b7ca9175eb7ca719d0f7f99fca8d032171 | [
"MIT"
] | null | null | null | init.py | kdkvcm/Py_Snake_Game | 96c7a6b7ca9175eb7ca719d0f7f99fca8d032171 | [
"MIT"
] | null | null | null | init.py | kdkvcm/Py_Snake_Game | 96c7a6b7ca9175eb7ca719d0f7f99fca8d032171 | [
"MIT"
] | null | null | null | # Import
import cv2
import sys
import random
import numpy as np
# Globals
WIDTH = 600 # Display Resolution Width
HEIGHT = 600 # Display Resolution Height
UNIT_BLOCK = 20 # Grid Size
PAUSE_TIME = 250 # Initial Pause Time
MIN_TIME = 125 # Minimum Wait Time
INC_LEVEL = 5 # Increment Level
SNAKE_LENGTH = 1... | 22.8 | 87 | 0.672515 |
import cv2
import sys
import random
import numpy as np
WIDTH = 600
HEIGHT = 600
UNIT_BLOCK = 20
PAUSE_TIME = 250
MIN_TIME = 125
INC_LEVEL = 5
SNAKE_LENGTH = 10
EXIT_KEY = 27
AI_MODE = 1
GREEN = (0, 255, 0)
RED = (0, 0, 255)
LEFT = -1
UP = -2
RIGHT = 1
DOWN = 2
gri... | true | true |
f7413926e8a69c8e6e3712759fd5c8cd20cd4176 | 2,261 | py | Python | Python/empire/deprecated_stuff/structs2/read_only_struct.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/deprecated_stuff/structs2/read_only_struct.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/deprecated_stuff/structs2/read_only_struct.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | from empire.python.typings import *
from empire.deprecated_stuff.structs2.struct_base import StructBase
from empire.deprecated_stuff.structs2.struct_util import StringifierFormatter
class ReadOnlyStruct(StructBase):
# NOTE: to exclude struct attributes to be used by these functions (and other functions fr... | 34.257576 | 118 | 0.541353 | from empire.python.typings import *
from empire.deprecated_stuff.structs2.struct_base import StructBase
from empire.deprecated_stuff.structs2.struct_util import StringifierFormatter
class ReadOnlyStruct(StructBase):
def __str__(self) -> str:
s: str = ''
for attr in self.__dict_... | true | true |
f74139b71739a99340342975b3fbbeeb399f8d1d | 3,800 | py | Python | applications/nightly_build/test_lsgan.py | Abrahamma97/keras-onnx | c82bc151843baa8ddb0af3c2997dfab9144e10bc | [
"MIT"
] | 1 | 2021-05-04T15:58:37.000Z | 2021-05-04T15:58:37.000Z | applications/nightly_build/test_lsgan.py | souptc/keras-onnx | c08d52bf4d4ec2bba69ec4ffd2ea14f47fecb1f5 | [
"MIT"
] | null | null | null | applications/nightly_build/test_lsgan.py | souptc/keras-onnx | c08d52bf4d4ec2bba69ec4ffd2ea14f47fecb1f5 | [
"MIT"
] | null | null | null | ###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... | 31.404959 | 107 | 0.652895 | true | true | |
f74139ee879327bafaa67c26de9ed2ff98cb5288 | 5,900 | py | Python | accelbyte_py_sdk/api/dsm_controller/operations/admin/count_server.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/dsm_controller/operations/admin/count_server.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/dsm_controller/operations/admin/count_server.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | # Auto-generated at 2021-09-27T17:01:22.744049+08:00
# from: Justice DsmController Service (2.4.0)
# Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# pylint: disable=duplicate-code
... | 27.314815 | 150 | 0.639492 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HttpResponse
from ...models import ModelsCountServerResponse
from ...models import ResponseError
class CountServer(Operation):
_url: str... | true | true |
f7413a62419546bd93d9b6fbab4c72a58151daa5 | 2,786 | py | Python | test/unit/test_state_store.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | test/unit/test_state_store.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | test/unit/test_state_store.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 30.282609 | 74 | 0.703877 |
import os
import os.path as op
from contextlib import contextmanager
from splunktalib import state_store
@contextmanager
def ignored(*exceptions):
try:
yield
except exceptions:
pass
def _clean_up(checkpoint_dir, filename):
with ignored(OSError):
os.remove(op.join(... | true | true |
f7413ac9bbb0b16e0d5d14f0733e4e7b84723717 | 33,811 | py | Python | src/VisitorCodeGenerator.py | arminnh/c-to-p-compilers | 2c649e1d3643471bac681c2656c1c7d6249be4d7 | [
"MIT"
] | 1 | 2021-04-29T06:40:54.000Z | 2021-04-29T06:40:54.000Z | src/VisitorCodeGenerator.py | arminnh/ba3-c-to-p-compiler | 2c649e1d3643471bac681c2656c1c7d6249be4d7 | [
"MIT"
] | null | null | null | src/VisitorCodeGenerator.py | arminnh/ba3-c-to-p-compiler | 2c649e1d3643471bac681c2656c1c7d6249be4d7 | [
"MIT"
] | 1 | 2017-01-30T19:19:31.000Z | 2017-01-30T19:19:31.000Z | from antlr4 import *
from AbstractSyntaxTree import *
from Visitor import *
from TypeInfo import TYPES
import copy
class VisitorCodeGenerator(Visitor):
def __init__(self, symbolTable, outFile="out.p"):
self.symbolTable = symbolTable
self.current = 0
self._lvalue = []
self.backLabel... | 41.793572 | 190 | 0.555263 | from antlr4 import *
from AbstractSyntaxTree import *
from Visitor import *
from TypeInfo import TYPES
import copy
class VisitorCodeGenerator(Visitor):
def __init__(self, symbolTable, outFile="out.p"):
self.symbolTable = symbolTable
self.current = 0
self._lvalue = []
self.backLabel... | true | true |
f7413cad998ad9d577892901f5129176075a725b | 9,047 | py | Python | nova/tests/api/openstack/compute/contrib/test_attach_interfaces.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 2 | 2015-11-05T04:52:34.000Z | 2016-03-07T03:00:06.000Z | nova/tests/api/openstack/compute/contrib/test_attach_interfaces.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 1 | 2018-01-19T07:50:49.000Z | 2018-01-19T07:50:49.000Z | nova/tests/api/openstack/compute/contrib/test_attach_interfaces.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 1 | 2020-07-24T07:32:11.000Z | 2020-07-24T07:32:11.000Z | # Copyright 2012 SINA 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 app... | 36.776423 | 79 | 0.632033 |
from oslo.config import cfg
from nova.api.openstack.compute.contrib import attach_interfaces
from nova.compute import api as compute_api
from nova import context
from nova import exception
from nova.network import api as network_api
from nova.openstack.common import jsonutils
from nova import test
impo... | true | true |
f7413d50fcb069015cbedf65363329f96bbb6651 | 998 | py | Python | envelope/settings.py | ikresoft/django-envelope | 44fe0d6373b23acc011b1da4f563c48a2eb5ae53 | [
"MIT"
] | null | null | null | envelope/settings.py | ikresoft/django-envelope | 44fe0d6373b23acc011b1da4f563c48a2eb5ae53 | [
"MIT"
] | null | null | null | envelope/settings.py | ikresoft/django-envelope | 44fe0d6373b23acc011b1da4f563c48a2eb5ae53 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Defaults and overrides for envelope-related settings.
"""
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_CONTACT_CHOICES = (
('', _("Choose")),
(10, _("A general question regarding the webs... | 29.352941 | 83 | 0.708417 |
from __future__ import unicode_literals
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
DEFAULT_CONTACT_CHOICES = (
('', _("Choose")),
(10, _("A general question regarding the website")),
(None, _("Other")),
)
FROM_EMAIL = settings.DEFAULT_FROM_EMAIL
CONTACT_... | true | true |
f7413d9cd8a6f553087b4fc0c75e19f3cf3e0b2b | 360 | py | Python | UnfoldUtils/__init__.py | sahenry11/CC-NuE-XSec | 56d59197718f2c18ab8c02fe34ad6e81cb994366 | [
"MIT"
] | null | null | null | UnfoldUtils/__init__.py | sahenry11/CC-NuE-XSec | 56d59197718f2c18ab8c02fe34ad6e81cb994366 | [
"MIT"
] | null | null | null | UnfoldUtils/__init__.py | sahenry11/CC-NuE-XSec | 56d59197718f2c18ab8c02fe34ad6e81cb994366 | [
"MIT"
] | null | null | null | # This file, and the fact that the other files here are in the subdirectory UnfoldUtils,
# exist only so that the line 'import UnfoldUtils' will work in other packages.
#
# See http://docs.python.org/2/tutorial/modules.html#packages if you're curious
# how this works.
# load the C++ objects and bind them into the name... | 40 | 88 | 0.766667 |
the C++ objects and bind them into the namespace.
from . import LoadUnfoldUtilsLib
| true | true |
f7413fceb35b27eae12028c97c9e79144f03574b | 130,914 | py | Python | OmniMarkupLib/Renderers/libs/pygments/lexers/_lasso_builtins.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | OmniMarkupLib/Renderers/libs/pygments/lexers/_lasso_builtins.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 82 | 2015-01-15T12:30:43.000Z | 2022-01-06T02:56:53.000Z | OmniMarkupLib/Renderers/libs/pygments/lexers/_lasso_builtins.py | henumohe/OmniMarkupPreviewer | a15382a8309fe04f2c515151c00c074ab9c0d1ab | [
"MIT"
] | 99 | 2015-01-14T19:53:45.000Z | 2021-08-11T15:17:26.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers._lasso_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Built-in Lasso types, traits, methods, and members.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTINS = {
'Types': (
'null'... | 25.258345 | 70 | 0.525712 |
BUILTINS = {
'Types': (
'null',
'void',
'tag',
'trait',
'integer',
'decimal',
'boolean',
'capture',
'string',
'bytes',
'keyword',
'custom',
'staticarray',
'signature',
'memberstream',
'd... | true | true |
f74142486a021f3aec23c70a9d47efa01e56f46c | 1,719 | py | Python | index/urls.py | Edwardhgj/meiduo | 38796f5caf54676eb5620f50ade5474ee8700ad8 | [
"MIT"
] | null | null | null | index/urls.py | Edwardhgj/meiduo | 38796f5caf54676eb5620f50ade5474ee8700ad8 | [
"MIT"
] | 6 | 2020-06-05T23:02:49.000Z | 2022-02-11T03:43:22.000Z | index/urls.py | Edwardhgj/meiduo | 38796f5caf54676eb5620f50ade5474ee8700ad8 | [
"MIT"
] | null | null | null | """day01 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | 37.369565 | 77 | 0.706225 | from django.contrib import admin
from django.urls import path,include,re_path
from index import views
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.settings import api_settings
from index.pay import page1,PaGe
urlpatterns = [
path('GetCateGoods/', views.GetCateGoods.as_view()),... | true | true |
f74142904c93ed9fd2fa1a26d434228f20ff9a21 | 10,577 | py | Python | test/unit/test_attention.py | Izecson/sockeye-1.16.6 | f84044d4a64b2bcf744ccd4f94b16f8133d1f383 | [
"Apache-2.0"
] | null | null | null | test/unit/test_attention.py | Izecson/sockeye-1.16.6 | f84044d4a64b2bcf744ccd4f94b16f8133d1f383 | [
"Apache-2.0"
] | null | null | null | test/unit/test_attention.py | Izecson/sockeye-1.16.6 | f84044d4a64b2bcf744ccd4f94b16f8133d1f383 | [
"Apache-2.0"
] | 1 | 2021-07-19T09:12:56.000Z | 2021-07-19T09:12:56.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | 52.361386 | 119 | 0.629668 |
import mxnet as mx
import numpy as np
import pytest
import sockeye.constants as C
import sockeye.coverage
import sockeye.rnn_attention
from test.common import gaussian_vector, integer_vector
attention_types = [C.ATT_BILINEAR, C.ATT_DOT, C.ATT_DOT_SCALED, C.ATT_LOC, C.ATT_MLP]
@pytest.mark.parametrize("... | true | true |
f74142993933802ce477fc41a013d2f797ba4683 | 15,541 | py | Python | accenv/bin/pildriver.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/bin/pildriver.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/bin/pildriver.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | #!/home/adam/django/Accountant/accenv/bin/python3
"""PILdriver, an image-processing calculator using PIL.
An instance of class PILDriver is essentially a software stack machine
(Polish-notation interpreter) for sequencing PIL image
transformations. The state of the instance is the interpreter stack.
The only method ... | 29.489564 | 79 | 0.591596 |
# 2. Add PILDraw operations.
# 3. Add support for composing and decomposing multiple-image files.
#
from __future__ import print_function
from PIL import Image
class PILDriver(object):
verbose = 0
def do_verbose(self):
self.verbose = int(self.do_pop())
# The evaluation stack (internal o... | true | true |
f74143a3cceec36ae5fcf89b679327c112e12e40 | 6,121 | py | Python | lldb/test/API/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py | rarutyun/llvm | 76fa6b3bcade074bdedef740001c4528e1aa08a8 | [
"Apache-2.0"
] | 305 | 2019-09-14T17:16:05.000Z | 2022-03-31T15:05:20.000Z | lldb/test/API/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py | rarutyun/llvm | 76fa6b3bcade074bdedef740001c4528e1aa08a8 | [
"Apache-2.0"
] | 11 | 2019-10-17T21:11:52.000Z | 2022-02-17T20:10:00.000Z | lldb/test/API/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py | rarutyun/llvm | 76fa6b3bcade074bdedef740001c4528e1aa08a8 | [
"Apache-2.0"
] | 24 | 2019-10-03T11:22:11.000Z | 2022-01-25T09:59:30.000Z | import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteExpeditedRegisters(
gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfDarwinEmbedded # <rdar://proble... | 38.25625 | 106 | 0.701029 | import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteExpeditedRegisters(
gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@skipIfDarwinEmbedded
def gather... | true | true |
f74143f83cc071ba5ba4f06f838c65ce7f89f1b7 | 1,124 | py | Python | kubernetes_asyncio/test/test_v2beta2_horizontal_pod_autoscaler_list.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v2beta2_horizontal_pod_autoscaler_list.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v2beta2_horizontal_pod_autoscaler_list.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 28.1 | 140 | 0.764235 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.models.v2beta2_horizontal_pod_autoscaler_list import V2beta2HorizontalPodAutoscalerList
from kubernetes_asyncio.client.rest import ApiException
class TestV2beta2HorizontalPodAutoscalerList(un... | true | true |
f741443a0b3a9e0b1dcff564bc561c597a383c55 | 431 | py | Python | challenges/hashmap_left_join/hashmap_left_join/linked_list.py | odai1990/data-structures-and-algorithms | fde43d7bdb241f6ef8de7018edab7e741b65cf77 | [
"MIT"
] | null | null | null | challenges/hashmap_left_join/hashmap_left_join/linked_list.py | odai1990/data-structures-and-algorithms | fde43d7bdb241f6ef8de7018edab7e741b65cf77 | [
"MIT"
] | 1 | 2021-06-13T19:18:34.000Z | 2021-06-13T19:18:34.000Z | challenges/hashmap_left_join/hashmap_left_join/linked_list.py | odai1990/data-structures-and-algorithms | fde43d7bdb241f6ef8de7018edab7e741b65cf77 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def add(self, data):
node = Node(data)
if not self.head:
self.head = node
else:
current = self.hea... | 19.590909 | 38 | 0.4942 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def add(self, data):
node = Node(data)
if not self.head:
self.head = node
else:
current = self.hea... | true | true |
f74144937808320e06cfaf008e3a566de43064b1 | 17,811 | py | Python | log_mito_bcl2/model_598.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_598.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_598.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
M... | 92.284974 | 798 | 0.801022 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'Xiap'])
... | true | true |
f74144cb7c7f004c29c17f81a7c2654a3d1b4bbd | 2,534 | py | Python | home/utils.py | kd46/Toddler-care-website | ca6e1e53201b5d19d5e47b61c646d44a32db02ac | [
"MIT"
] | 1 | 2021-07-23T06:45:38.000Z | 2021-07-23T06:45:38.000Z | home/utils.py | krishdesai62/Toddler-care-website | 0e2edc9b941d05792aa81e376912a5e502cb5fa5 | [
"MIT"
] | null | null | null | home/utils.py | krishdesai62/Toddler-care-website | 0e2edc9b941d05792aa81e376912a5e502cb5fa5 | [
"MIT"
] | null | null | null | import json
from . models import *
def cookieCart(request):
try:
cart = json.loads(request.COOKIES['cart'])
except:
cart={}
print('Cart:',cart)
items=[]
order = {'get_cart_total': 0, 'get_cart_items': 0,'shipping': False}
cartItems = order['get_cart_items']
... | 26.957447 | 87 | 0.52131 | import json
from . models import *
def cookieCart(request):
try:
cart = json.loads(request.COOKIES['cart'])
except:
cart={}
print('Cart:',cart)
items=[]
order = {'get_cart_total': 0, 'get_cart_items': 0,'shipping': False}
cartItems = order['get_cart_items']
... | true | true |
f74144ef612f5812df9cacf9768062368ab65dcf | 673 | py | Python | trilinear_cpp/setup.py | yileiCao/shareTheBest | ef62396a7884954dd6464d2dd78e232273e1060b | [
"MIT"
] | 449 | 2020-07-08T07:58:44.000Z | 2022-03-31T12:47:53.000Z | trilinear_cpp/setup.py | yileiCao/shareTheBest | ef62396a7884954dd6464d2dd78e232273e1060b | [
"MIT"
] | 59 | 2020-09-27T12:30:54.000Z | 2022-03-16T06:32:25.000Z | trilinear_cpp/setup.py | yileiCao/shareTheBest | ef62396a7884954dd6464d2dd78e232273e1060b | [
"MIT"
] | 83 | 2020-09-27T09:16:27.000Z | 2022-03-30T12:34:15.000Z | from setuptools import setup
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
if torch.cuda.is_available():
print('Including CUDA code.')
setup(
name='trilinear',
ext_modules=[
CUDAExtension('trilinear', [
'src/trilinear_... | 29.26087 | 81 | 0.604755 | from setuptools import setup
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
if torch.cuda.is_available():
print('Including CUDA code.')
setup(
name='trilinear',
ext_modules=[
CUDAExtension('trilinear', [
'src/trilinear_... | true | true |
f741454dd525cc295f44c7e110b4b7c8a88ec169 | 23,427 | py | Python | response_model/python/population_subunits/coarse/analysis/analysis_util.py | googlearchive/rgc-models | 0dea94bbd54f591d82d95169e33d40bb55b6be94 | [
"Apache-2.0"
] | 1 | 2018-09-18T16:47:09.000Z | 2018-09-18T16:47:09.000Z | response_model/python/population_subunits/coarse/analysis/analysis_util.py | google/rgc-models | 0dea94bbd54f591d82d95169e33d40bb55b6be94 | [
"Apache-2.0"
] | null | null | null | response_model/python/population_subunits/coarse/analysis/analysis_util.py | google/rgc-models | 0dea94bbd54f591d82d95169e33d40bb55b6be94 | [
"Apache-2.0"
] | 1 | 2022-01-12T12:44:17.000Z | 2022-01-12T12:44:17.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 33.854046 | 131 | 0.627524 |
"""Utils for analysis of fitted models."""
import sys
import os.path
import collections
import tensorflow as tf
from absl import app
from absl import flags
from absl import gfile
import cPickle as pickle
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pylab
import matplotlib.pyplot as pl... | false | true |
f74145539edf6853b0fccc22a988203e4fa5355d | 1,782 | py | Python | application/Tests/test_integration.py | AmirAR-QA/Project1 | 341e89c17b04c8f6a3528a4d013efb8acc70431f | [
"Unlicense"
] | null | null | null | application/Tests/test_integration.py | AmirAR-QA/Project1 | 341e89c17b04c8f6a3528a4d013efb8acc70431f | [
"Unlicense"
] | null | null | null | application/Tests/test_integration.py | AmirAR-QA/Project1 | 341e89c17b04c8f6a3528a4d013efb8acc70431f | [
"Unlicense"
] | null | null | null | from flask_testing import LiveServerTestCase
from selenium import webdriver
from urllib.request import urlopen
from flask import url_for
from application import app, db
from application.models import Players, Items
class TestBase(LiveServerTestCase):
def create_app(self):
app.config["SQLALCHEMY_DATABASE_... | 34.941176 | 88 | 0.673962 | from flask_testing import LiveServerTestCase
from selenium import webdriver
from urllib.request import urlopen
from flask import url_for
from application import app, db
from application.models import Players, Items
class TestBase(LiveServerTestCase):
def create_app(self):
app.config["SQLALCHEMY_DATABASE_... | true | true |
f741462643c416e345b8001d8fb2a1cc7cb72549 | 3,177 | py | Python | src/Driver.py | alexiskulash/ia-caucus-sentiment | 7ea004a9efb98e44aefcc138241cc884dae5b5af | [
"MIT"
] | null | null | null | src/Driver.py | alexiskulash/ia-caucus-sentiment | 7ea004a9efb98e44aefcc138241cc884dae5b5af | [
"MIT"
] | null | null | null | src/Driver.py | alexiskulash/ia-caucus-sentiment | 7ea004a9efb98e44aefcc138241cc884dae5b5af | [
"MIT"
] | null | null | null | #Jenny Steffens
from Analysis import *
import random, time
def main():
# This list and dictionary are now the default in the Analyzer. They
# do not need to be entered in a driver. However, if the dictionary is updated,
# either do so in Analysis.py or when initializing, set kD= name of new dicitonary
# dic... | 25.214286 | 115 | 0.667296 |
from Analysis import *
import random, time
def main():
keyword_list = ["HillaryClinton", "Hillary2016", "Hillary",
"Lessig", "Lessig2016", "Lessig2016",
"O'Malley", "OMalley2016", "MartinOMalley",
"Bernie", "FeelTheBern", "Bernie2016",
"Jeb", "JebBush", "Jeb2016",
"Carson", "BC2DC16", "RealBenCar... | true | true |
f741485414cc641acff25c5906e13b5eea01446c | 4,887 | py | Python | weibo/settings.py | Leu552/cxkspider | 94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230 | [
"MIT"
] | null | null | null | weibo/settings.py | Leu552/cxkspider | 94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230 | [
"MIT"
] | null | null | null | weibo/settings.py | Leu552/cxkspider | 94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
from fake_useragent import UserAgent
ua = UserAgent()
PROXIES = ['http://116.209.54.2:9999', 'http://61.176.223.7:58822', 'http://183.148.146.206:9999',
'http://110.52.235.38:9999', 'http://110.52.235.44:9999', 'http://116.209.58.167:9999',
]
# Scrapy settin... | 44.834862 | 1,305 | 0.78494 |
import random
from fake_useragent import UserAgent
ua = UserAgent()
PROXIES = ['http://116.209.54.2:9999', 'http://61.176.223.7:58822', 'http://183.148.146.206:9999',
'http://110.52.235.38:9999', 'http://110.52.235.44:9999', 'http://116.209.58.167:9999',
]
BOT_NAME = 'weibo'
SPIDER_MO... | true | true |
f741486590bb0203e6d09f545940805d623d7c70 | 1,137 | py | Python | scripts/model/bigram_svm/train_model.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/model/bigram_svm/train_model.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/model/bigram_svm/train_model.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
# %% Load ... | 31.583333 | 94 | 0.740545 | import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
df = pd.r... | true | true |
f74149ad7f8465e38dbde97a2066db1c4e45a4dc | 443 | py | Python | practice_problems/StaticLinkedList.py | smenon8/practice_scripts | 2a07cb12c75bd9b5ee5140cbe38e23d92835a108 | [
"MIT"
] | null | null | null | practice_problems/StaticLinkedList.py | smenon8/practice_scripts | 2a07cb12c75bd9b5ee5140cbe38e23d92835a108 | [
"MIT"
] | 1 | 2017-02-13T20:48:06.000Z | 2017-02-13T20:48:06.000Z | practice_problems/StaticLinkedList.py | smenon8/AlgDataStruct_practice | 2a07cb12c75bd9b5ee5140cbe38e23d92835a108 | [
"MIT"
] | null | null | null | # static linked list
class StaticNode:
def __init__(self,value):
self.next = -1
self.value = value
class StaticLinkedList:
def __init__(self,numNodes):
self.head = -2
self.array = [Node(-1)]*numNodes
def push(self,node):
if self.head == -2:
self.head = 0
node.next = 1
else:
cu... | 22.15 | 38 | 0.613995 |
class StaticNode:
def __init__(self,value):
self.next = -1
self.value = value
class StaticLinkedList:
def __init__(self,numNodes):
self.head = -2
self.array = [Node(-1)]*numNodes
def push(self,node):
if self.head == -2:
self.head = 0
node.next = 1
else:
curr = head
while s... | true | true |
f74149bcd9104fdda4c80e41865473e7ac09b1d3 | 13,253 | py | Python | slm_lab/agent/algorithm/dqn.py | wilson1yan/SLM-Lab | 1f110288d2d3dde1fb00d415aeb95ce554170813 | [
"MIT"
] | null | null | null | slm_lab/agent/algorithm/dqn.py | wilson1yan/SLM-Lab | 1f110288d2d3dde1fb00d415aeb95ce554170813 | [
"MIT"
] | null | null | null | slm_lab/agent/algorithm/dqn.py | wilson1yan/SLM-Lab | 1f110288d2d3dde1fb00d415aeb95ce554170813 | [
"MIT"
] | null | null | null | from slm_lab.agent import net
from slm_lab.agent.algorithm import policy_util
from slm_lab.agent.algorithm.sarsa import SARSA
from slm_lab.agent.net import net_util
from slm_lab.lib import logger, util
from slm_lab.lib.decorator import lab_api
import numpy as np
import pydash as ps
import torch
logger = logger.get_log... | 43.029221 | 317 | 0.634422 | from slm_lab.agent import net
from slm_lab.agent.algorithm import policy_util
from slm_lab.agent.algorithm.sarsa import SARSA
from slm_lab.agent.net import net_util
from slm_lab.lib import logger, util
from slm_lab.lib.decorator import lab_api
import numpy as np
import pydash as ps
import torch
logger = logger.get_log... | true | true |
f7414aeec9c1ee66ec6c7daf36e11a8a41cbdd96 | 382 | py | Python | setup.py | richimus123/speed_reader | b824a765b5e2c51421046e960ce49f65a2063c35 | [
"MIT"
] | null | null | null | setup.py | richimus123/speed_reader | b824a765b5e2c51421046e960ce49f65a2063c35 | [
"MIT"
] | null | null | null | setup.py | richimus123/speed_reader | b824a765b5e2c51421046e960ce49f65a2063c35 | [
"MIT"
] | null | null | null | """Simple Cython package setup."""
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
source_files = [
'lib.py',
'libc.pyx',
'libc.c',
]
extensions = [Extension("lib", source_files)]
setup(
ext_modules=cythonize(extensions),
version='0.0... | 18.190476 | 45 | 0.691099 |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
source_files = [
'lib.py',
'libc.pyx',
'libc.c',
]
extensions = [Extension("lib", source_files)]
setup(
ext_modules=cythonize(extensions),
version='0.0.1',
name='speed_reader',
m... | true | true |
f7414c013bbcd713b305fdfff5126e3376a8ed6d | 1,196 | py | Python | setup.py | jvzantvoort/pyarchive | 9b580f52a27fed1533b7121917580a42fb0a7fc5 | [
"MIT"
] | null | null | null | setup.py | jvzantvoort/pyarchive | 9b580f52a27fed1533b7121917580a42fb0a7fc5 | [
"MIT"
] | null | null | null | setup.py | jvzantvoort/pyarchive | 9b580f52a27fed1533b7121917580a42fb0a7fc5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import io
import os
import re
setup_path = os.path.abspath(__file__)
setup_path_dir = os.path.dirname(setup_path)
exec(open(os.path.join(setup_path_dir, 'pyarchive', 'version.py')).read())
long_description = "coarse tool to mo... | 28.47619 | 76 | 0.657191 |
from setuptools import setup, find_packages
import io
import os
import re
setup_path = os.path.abspath(__file__)
setup_path_dir = os.path.dirname(setup_path)
exec(open(os.path.join(setup_path_dir, 'pyarchive', 'version.py')).read())
long_description = "coarse tool to move targets to a type specific location"
set... | true | true |
f7414c5cdc14bcacced574c16ecc971fff2e715b | 3,152 | py | Python | gameplan2/settings.py | aneesahmed/gameplan2 | 7f7acd9c02c951ee1b25131334199d5a72073b66 | [
"Apache-2.0"
] | null | null | null | gameplan2/settings.py | aneesahmed/gameplan2 | 7f7acd9c02c951ee1b25131334199d5a72073b66 | [
"Apache-2.0"
] | null | null | null | gameplan2/settings.py | aneesahmed/gameplan2 | 7f7acd9c02c951ee1b25131334199d5a72073b66 | [
"Apache-2.0"
] | null | null | null | """
Django settings for gameplan2 project.
Generated by 'django-admin startproject' using Django 1.8.18.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | 25.626016 | 71 | 0.675444 |
import os
import os.path
Temp_Path = os.path.realpath('.')
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'by@l(i-g*1!7(e71@r0&3=gj+zrc!hzn#jw!chu+i=-*q#ufb('
DEBUG = True
ALLOWED_HOSTS = []
# Application definitioScrumConfign
INSTALLED_APPS = (
'scrum.apps.ScrumC... | true | true |
f7414d1afb1915675e1378731f5f561aaa716f72 | 5,252 | py | Python | tornado_demo/web2py/applications/welcome/models/menu.py | ls-2018/tips | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | 2 | 2019-05-07T03:08:25.000Z | 2020-05-22T10:10:00.000Z | tornado_demo/web2py/applications/welcome/models/menu.py | ls-2018/tips | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | 7 | 2020-05-22T13:29:42.000Z | 2021-09-23T23:30:25.000Z | tornado_demo/web2py/applications/welcome/models/menu.py | ls-2018/py | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# ----------------------------------------------------------------------------------------------------------------------
# this is the main application menu add/remove items as required
# ---------------------------... | 47.745455 | 120 | 0.454494 |
response.menu = [
(T('Home'), False, URL('default', 'index'), [])
]
if not configuration.get('app.production'):
_app = request.application
response.menu += [
(T('My Sites'), False, URL('admin', 'default', 'site')),
(T('This App'), False, '#', [
(T('Design'), False, UR... | true | true |
f7414d5480215f4bc05605e00eed9715e971a84d | 5,422 | py | Python | homeassistant/components/nuki/lock.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 5 | 2020-09-17T21:47:23.000Z | 2021-06-04T04:37:29.000Z | homeassistant/components/nuki/lock.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/nuki/lock.py | squirrel289/core | 6c5bcbfc3ee40927458e9188d6b79bf63933d3f9 | [
"Apache-2.0"
] | 2 | 2017-09-03T16:06:02.000Z | 2021-01-12T15:07:52.000Z | """Nuki.io lock platform."""
from abc import ABC, abstractmethod
from datetime import timedelta
import logging
from pynuki import NukiBridge
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity
from homeassistant.... | 27.663265 | 88 | 0.65474 | from abc import ABC, abstractmethod
from datetime import timedelta
import logging
from pynuki import NukiBridge
from requests.exceptions import RequestException
import voluptuous as vol
from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity
from homeassistant.const import ATTR_ENTITY_ID, ... | true | true |
f7414e3f469f6d399018e369e8cc8df87c4996fc | 11,287 | py | Python | gorillabot/plugins/link.py | pep7/GorillaBot | b29ae1f05423494f7e122906efe24e9ffcd1421e | [
"MIT"
] | null | null | null | gorillabot/plugins/link.py | pep7/GorillaBot | b29ae1f05423494f7e122906efe24e9ffcd1421e | [
"MIT"
] | null | null | null | gorillabot/plugins/link.py | pep7/GorillaBot | b29ae1f05423494f7e122906efe24e9ffcd1421e | [
"MIT"
] | null | null | null | # Copyright (c) 2013-2016 Molly White
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# di... | 44.437008 | 104 | 0.565341 |
from plugins.util import command, get_url
from urllib.parse import quote
from html import unescape
from datetime import datetime
import json
import re
@command()
def link(m, urls=None, wikilinks=None):
... | true | true |
f7414ecb804f0cb3833626c69c9c23845e729960 | 1,523 | py | Python | examples/plotting/file/stocks.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | 1 | 2019-10-25T04:37:10.000Z | 2019-10-25T04:37:10.000Z | examples/plotting/file/stocks.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | 2 | 2021-05-08T11:43:21.000Z | 2021-05-10T19:16:43.000Z | examples/plotting/file/stocks.py | Connossor/bokeh | 092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e | [
"BSD-3-Clause"
] | 1 | 2021-08-20T20:01:26.000Z | 2021-08-20T20:01:26.000Z | import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.stocks import AAPL, GOOG, IBM, MSFT
def datetime(x):
return np.array(x, dtype=np.datetime64)
p1 = figure(x_axis_type="datetime", title="Stock Closing Prices")
p1.grid.grid_line_alpha=0... | 34.613636 | 88 | 0.730138 | import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.stocks import AAPL, GOOG, IBM, MSFT
def datetime(x):
return np.array(x, dtype=np.datetime64)
p1 = figure(x_axis_type="datetime", title="Stock Closing Prices")
p1.grid.grid_line_alpha=0... | true | true |
f7414fecf292d21484a7fef187ae5df3f1fc1f95 | 1,238 | py | Python | CTFd/utils/email/__init__.py | ramadistra/CTFd | f66b488a9991db1103311cdc91003f0558ca9253 | [
"Apache-2.0"
] | 2 | 2019-06-19T07:11:28.000Z | 2019-06-21T05:30:07.000Z | CTFd/utils/email/__init__.py | ramadistra/CTFd | f66b488a9991db1103311cdc91003f0558ca9253 | [
"Apache-2.0"
] | 6 | 2019-01-26T15:06:07.000Z | 2019-02-11T01:48:20.000Z | CTFd/utils/email/__init__.py | ramadistra/CTFd | f66b488a9991db1103311cdc91003f0558ca9253 | [
"Apache-2.0"
] | 1 | 2019-11-09T19:00:41.000Z | 2019-11-09T19:00:41.000Z | from flask import current_app as app, url_for
from CTFd.utils import get_config, get_app_config
from CTFd.utils.config import get_mail_provider, mailserver
from CTFd.utils.email import mailgun, smtp
from CTFd.utils.security.signing import serialize
import re
EMAIL_REGEX = r"(^[^@\s]+@[^@\s]+\.[^@\s]+$)"
def sendmai... | 28.136364 | 116 | 0.698708 | from flask import current_app as app, url_for
from CTFd.utils import get_config, get_app_config
from CTFd.utils.config import get_mail_provider, mailserver
from CTFd.utils.email import mailgun, smtp
from CTFd.utils.security.signing import serialize
import re
EMAIL_REGEX = r"(^[^@\s]+@[^@\s]+\.[^@\s]+$)"
def sendmai... | true | true |
f74151657fcfc156c25636f6a0e97633a571bb42 | 169 | py | Python | Conteudo das Aulas/033/Exemplos/Exemplo 1.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/033/Exemplos/Exemplo 1.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | Conteudo das Aulas/033/Exemplos/Exemplo 1.py | cerberus707/lab-python | ebba3c9cde873d70d4bb61084f79ce30b7f9e047 | [
"Apache-2.0"
] | null | null | null | #1 - Função que retorna uma variável:
"""
Escreva uma função de potenciação
"""
def potência(base, exp):
pot = base**exp
return pot
a = potência(2,3)
print(a)
| 14.083333 | 37 | 0.656805 |
def potência(base, exp):
pot = base**exp
return pot
a = potência(2,3)
print(a)
| true | true |
f74151911ebe7f51b83eb41a6d7a1f442d287bba | 10,274 | py | Python | src/sdm_modbus/meter.py | nx6110a5100/sdm_modbus | faab945ae582b68e6246310bbf832f08455e4fc7 | [
"MIT"
] | 10 | 2020-06-30T14:28:01.000Z | 2022-01-20T14:57:45.000Z | src/sdm_modbus/meter.py | nx6110a5100/sdm_modbus | faab945ae582b68e6246310bbf832f08455e4fc7 | [
"MIT"
] | 12 | 2020-07-04T14:24:04.000Z | 2022-01-11T19:48:15.000Z | src/sdm_modbus/meter.py | nx6110a5100/sdm_modbus | faab945ae582b68e6246310bbf832f08455e4fc7 | [
"MIT"
] | 18 | 2020-06-27T07:01:43.000Z | 2022-03-21T10:22:12.000Z | import enum
import time
from pymodbus.constants import Endian
from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client.sync import ModbusSerialClient
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.register_read_message import ReadInputRegi... | 31.612308 | 199 | 0.562293 | import enum
import time
from pymodbus.constants import Endian
from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client.sync import ModbusSerialClient
from pymodbus.payload import BinaryPayloadBuilder
from pymodbus.payload import BinaryPayloadDecoder
from pymodbus.register_read_message import ReadInputRegi... | true | true |
f74151ce1e3b927898173e541d389308137585c5 | 30,457 | py | Python | pyapprox/optimization.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | pyapprox/optimization.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | pyapprox/optimization.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import minimize, Bounds
from functools import partial
from scipy.stats import gaussian_kde as KDE
from pyapprox.configure_plots import *
import scipy.stats as ss
from pyapprox.utilities import get_all_sample_combinations
def approx_jacobian(func, x, *args, epsilon=np.sqrt(np.finf... | 40.075 | 106 | 0.650786 | import numpy as np
from scipy.optimize import minimize, Bounds
from functools import partial
from scipy.stats import gaussian_kde as KDE
from pyapprox.configure_plots import *
import scipy.stats as ss
from pyapprox.utilities import get_all_sample_combinations
def approx_jacobian(func, x, *args, epsilon=np.sqrt(np.finf... | true | true |
f74152160c9a622be3b83e89f20ac545c85f59b1 | 277 | py | Python | junn-predict/junn_predict/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn-predict/junn_predict/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | junn-predict/junn_predict/__init__.py | modsim/junn | a40423b98c6a3739dd0b2ba02d546a5db91f9215 | [
"BSD-2-Clause"
] | null | null | null | """JUNN, the Jülich U-Net Neural Network Segmentation Toolkit - prediction module."""
__project__ = 'JUNN'
__version__ = '1.0.0'
__author__ = 'Christian C. Sachs'
__copyright__ = '2021, Christian C. Sachs, Forschungszentrum Jülich GmbH'
__citation__ = ''
__banner__ = ''
| 19.785714 | 85 | 0.722022 |
__project__ = 'JUNN'
__version__ = '1.0.0'
__author__ = 'Christian C. Sachs'
__copyright__ = '2021, Christian C. Sachs, Forschungszentrum Jülich GmbH'
__citation__ = ''
__banner__ = ''
| true | true |
f74153cdb64a1f213f0fce99d337c08a07e98068 | 6,771 | py | Python | djmodels/db/models/manager.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | 5 | 2019-02-15T16:47:50.000Z | 2021-12-26T18:52:23.000Z | djmodels/db/models/manager.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | null | null | null | djmodels/db/models/manager.py | iMerica/dj-models | fbe4a55ac362f9355a2298f58aa0deb0b6082e19 | [
"BSD-3-Clause"
] | 2 | 2021-08-09T02:29:09.000Z | 2021-08-20T03:30:11.000Z | import copy
import inspect
from importlib import import_module
from djmodels.db import router
from djmodels.db.models.query import QuerySet
class BaseManager:
# To retain order, track each time a Manager instance is created.
creation_counter = 0
# Set to True for the 'objects' managers that are automati... | 33.519802 | 93 | 0.593265 | import copy
import inspect
from importlib import import_module
from djmodels.db import router
from djmodels.db.models.query import QuerySet
class BaseManager:
creation_counter = 0
auto_created = False
use_in_migrations = False
def __new__(cls, *args, **kwargs):
... | true | true |
f74154377fbb1d5d917c303568d87f82cb1b6669 | 4,656 | py | Python | alembic/env.py | notconfusing/CivilServant | f9c7a2cf4de4f6506e37b7c33a7e512b893069c3 | [
"MIT"
] | 17 | 2017-03-13T15:14:57.000Z | 2020-01-07T19:12:49.000Z | alembic/env.py | notconfusing/CivilServant | f9c7a2cf4de4f6506e37b7c33a7e512b893069c3 | [
"MIT"
] | 32 | 2016-06-08T03:35:43.000Z | 2016-11-30T18:50:49.000Z | alembic/env.py | notconfusing/CivilServant | f9c7a2cf4de4f6506e37b7c33a7e512b893069c3 | [
"MIT"
] | 4 | 2018-07-11T23:36:28.000Z | 2019-11-16T19:32:33.000Z | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
import re
USE_TWOPHASE = False
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context... | 31.890411 | 98 | 0.645833 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
import re
USE_TWOPHASE = False
config = context.config
fileConfig(config.config_file_name)
logger = logging.getLogger('alembic.env')
db_names ... | true | true |
f74154d8dfb173a3ca54cfdc15e57311840b83f5 | 65 | py | Python | venv/Lib/site-packages/virtualenv/version.py | K-a-t-i/Kindergarten | fcb209737608f34a9ad0de40451a2f5a1a08d7ed | [
"MIT"
] | null | null | null | venv/Lib/site-packages/virtualenv/version.py | K-a-t-i/Kindergarten | fcb209737608f34a9ad0de40451a2f5a1a08d7ed | [
"MIT"
] | null | null | null | venv/Lib/site-packages/virtualenv/version.py | K-a-t-i/Kindergarten | fcb209737608f34a9ad0de40451a2f5a1a08d7ed | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
__version__ = "20.4.4"
| 16.25 | 40 | 0.784615 | from __future__ import unicode_literals
__version__ = "20.4.4"
| true | true |
f74155120ab8b8f295e0a30354e04305e6ec83a2 | 5,651 | py | Python | xarray/tutorial.py | santisoler/xarray | 49aa235fc63706dc145128dd13fdf139b9d5bc6e | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | xarray/tutorial.py | santisoler/xarray | 49aa235fc63706dc145128dd13fdf139b9d5bc6e | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2021-04-14T21:47:20.000Z | 2022-02-14T03:05:53.000Z | xarray/tutorial.py | weiji14/xarray | 2bb5d20fb2b4158390ab05aa6bf598b78f2caa9d | [
"CC-BY-4.0",
"PSF-2.0",
"BSD-2-Clause",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | """
Useful for:
* users learning xarray
* building tutorials in the documentation.
"""
import os
import pathlib
import numpy as np
from .backends.api import open_dataset as _open_dataset
from .backends.rasterio_ import open_rasterio as _open_rasterio
from .core.dataarray import DataArray
from .core.dataset import D... | 26.406542 | 94 | 0.620244 | import os
import pathlib
import numpy as np
from .backends.api import open_dataset as _open_dataset
from .backends.rasterio_ import open_rasterio as _open_rasterio
from .core.dataarray import DataArray
from .core.dataset import Dataset
_default_cache_dir_name = "xarray_tutorial_data"
base_url = "https://github.com/p... | true | true |
f7415586f806c3f50a37f313db6058892719c00e | 2,104 | py | Python | jl_exp_deconv/due.py | JLans/jl_exp_deconv | b146d9b930855c5a7220d71157398ffd2c631e72 | [
"MIT"
] | null | null | null | jl_exp_deconv/due.py | JLans/jl_exp_deconv | b146d9b930855c5a7220d71157398ffd2c631e72 | [
"MIT"
] | null | null | null | jl_exp_deconv/due.py | JLans/jl_exp_deconv | b146d9b930855c5a7220d71157398ffd2c631e72 | [
"MIT"
] | null | null | null | # emacs: at the end of the file
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
"""
Stub file for a guaranteed safe import of duecredit constructs: if duecredit
is not available.
To use it, place it into your project codebase to be imported, e.g. c... | 28.053333 | 80 | 0.625951 | true | true | |
f7415587b87ab2fe249de2a836fe7a2356cddc6f | 2,896 | py | Python | tests/test_agent.py | TiboC/rasa_core | 5c025fad44302164af0d6c2767fc1b6a49131b67 | [
"Apache-2.0"
] | 2 | 2021-04-20T03:20:26.000Z | 2022-01-20T02:04:52.000Z | tests/test_agent.py | TiboC/rasa_core | 5c025fad44302164af0d6c2767fc1b6a49131b67 | [
"Apache-2.0"
] | null | null | null | tests/test_agent.py | TiboC/rasa_core | 5c025fad44302164af0d6c2767fc1b6a49131b67 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import rasa_core
import pytest
import responses
from rasa_core.agent import Agent
from rasa_core.interpreter import INTENT_MESSAGE_PREFIX
from rasa_core.polic... | 36.2 | 80 | 0.700276 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import rasa_core
import pytest
import responses
from rasa_core.agent import Agent
from rasa_core.interpreter import INTENT_MESSAGE_PREFIX
from rasa_core.polic... | true | true |
f74155fe1b1a3778a3d4f7672184c489c042c149 | 2,466 | py | Python | dota2py/data.py | andrewsnowden/dota2py | 67637f4b9c160ea90c11b7e81545baf350affa7a | [
"MIT"
] | 86 | 2015-01-05T02:03:10.000Z | 2021-07-06T02:38:20.000Z | dota2py/data.py | andrewsnowden/dota2py | 67637f4b9c160ea90c11b7e81545baf350affa7a | [
"MIT"
] | 8 | 2015-01-20T15:24:20.000Z | 2018-11-29T07:35:53.000Z | dota2py/data.py | andrewsnowden/dota2py | 67637f4b9c160ea90c11b7e81545baf350affa7a | [
"MIT"
] | 29 | 2015-01-20T15:26:50.000Z | 2019-08-30T14:49:28.000Z | """
ID lookups from data files
Thanks to Lazze for the item list:
http://dev.dota2.com/showthread.php?t=47115&page=16&p=296787#post296787
"""
import os.path
import json
HEROES_CACHE = {}
ITEMS_CACHE = {}
GAME_MODES = {
"dota_game_mode_0": "-",
"dota_game_mode_1": "All Pick",
"dota_game_mode_2": "Captain... | 21.823009 | 77 | 0.627332 |
import os.path
import json
HEROES_CACHE = {}
ITEMS_CACHE = {}
GAME_MODES = {
"dota_game_mode_0": "-",
"dota_game_mode_1": "All Pick",
"dota_game_mode_2": "Captains Mode",
"dota_game_mode_3": "Random Draft",
"dota_game_mode_4": "Single Draft",
"dota_game_mode_5": "All Random",
"dota_game_m... | true | true |
f74156a49da0e38543f371449fed00f08dc5dfa3 | 173 | py | Python | V2/test/opencv_test/src/example.py | wisrovi/MANITOR-Raspberry | 342f740d5f5225734917bfd9fb59974881f7b5a6 | [
"MIT"
] | null | null | null | V2/test/opencv_test/src/example.py | wisrovi/MANITOR-Raspberry | 342f740d5f5225734917bfd9fb59974881f7b5a6 | [
"MIT"
] | null | null | null | V2/test/opencv_test/src/example.py | wisrovi/MANITOR-Raspberry | 342f740d5f5225734917bfd9fb59974881f7b5a6 | [
"MIT"
] | null | null | null | from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
sleep(2)
camera.capture('output.jpg')
exit()
| 19.222222 | 31 | 0.768786 | from time import sleep
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
sleep(2)
camera.capture('output.jpg')
exit()
| true | true |
f74156a8374539d7eb80eb9b4b4757cb3a498c38 | 39 | py | Python | VisualVenv/__main__.py | braffel14/VisualVenv | 15ec3309a754b1397babf0cae69e5470fbf09f83 | [
"MIT"
] | null | null | null | VisualVenv/__main__.py | braffel14/VisualVenv | 15ec3309a754b1397babf0cae69e5470fbf09f83 | [
"MIT"
] | null | null | null | VisualVenv/__main__.py | braffel14/VisualVenv | 15ec3309a754b1397babf0cae69e5470fbf09f83 | [
"MIT"
] | null | null | null | from VisualVenv.run import main
main() | 13 | 31 | 0.794872 | from VisualVenv.run import main
main() | true | true |
f74156b91836631bfc0083132ebd852a7bb557da | 40,337 | py | Python | cinder-14.0.0/cinder/exception.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | cinder-14.0.0/cinder/exception.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | cinder-14.0.0/cinder/exception.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 28.874016 | 79 | 0.706101 |
from oslo_log import log as logging
from oslo_versionedobjects import exception as obj_exc
import six
import webob.exc
from webob.util import status_generic_reasons
from webob.util import status_reasons
from cinder.i18n import _
LOG = logging.getLogger(__name__)
class ConvertedException(webob.exc.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.