hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71f46e9b66f50d5da46a8294920b9f874abe804 | 7,438 | py | Python | oauth2_provider/oauth2_backends.py | Transparent-CDN/django-oauth-toolkit | 0fb3d5a959ef2108c606e71064986b239540cab5 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-02-28T11:09:33.000Z | 2020-02-28T11:09:33.000Z | oauth2_provider/oauth2_backends.py | Transparent-CDN/django-oauth-toolkit | 0fb3d5a959ef2108c606e71064986b239540cab5 | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2019-03-22T17:06:36.000Z | 2019-06-20T02:41:33.000Z | oauth2_provider/oauth2_backends.py | drchrono/django-oauth-toolkit | 846ab0ba8acaa3e4870b424700544aa6329511e4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-10-19T01:03:44.000Z | 2019-10-19T01:03:44.000Z | import json
from urllib.parse import urlparse, urlunparse
from oauthlib import oauth2
from oauthlib.common import quote, urlencode, urlencoded
from .exceptions import FatalClientError, OAuthToolkitError
from .settings import oauth2_settings
class OAuthLibCore(object):
"""
TODO: add docs
"""
def __in... | 37.565657 | 109 | 0.655956 | import json
from urllib.parse import urlparse, urlunparse
from oauthlib import oauth2
from oauthlib.common import quote, urlencode, urlencoded
from .exceptions import FatalClientError, OAuthToolkitError
from .settings import oauth2_settings
class OAuthLibCore(object):
def __init__(self, server=None):
se... | true | true |
f71f48f8e33574e8e90e99e4f9578c5f409fad74 | 946 | py | Python | setup.py | kellyjonbrazil/jtbl | 9bfc755bc964fbed59a4884bc4be605a5065f3d8 | [
"MIT"
] | 108 | 2020-03-10T13:22:03.000Z | 2022-03-30T03:09:38.000Z | setup.py | kellyjonbrazil/jtbl | 9bfc755bc964fbed59a4884bc4be605a5065f3d8 | [
"MIT"
] | 9 | 2020-03-08T00:44:38.000Z | 2022-02-15T19:36:04.000Z | setup.py | kellyjonbrazil/jtbl | 9bfc755bc964fbed59a4884bc4be605a5065f3d8 | [
"MIT"
] | 5 | 2020-03-10T11:34:18.000Z | 2021-08-02T10:57:43.000Z | import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='jtbl',
version='1.1.7',
author='Kelly Brazil',
author_email='kellyjonbrazil@gmail.com',
description='A simple cli tool to print JSON and JSON Lines data as a table in the terminal.',
ins... | 28.666667 | 98 | 0.616279 | import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='jtbl',
version='1.1.7',
author='Kelly Brazil',
author_email='kellyjonbrazil@gmail.com',
description='A simple cli tool to print JSON and JSON Lines data as a table in the terminal.',
ins... | true | true |
f71f497fb7582513c2d45b7633de0c7c9d7f7303 | 3,186 | py | Python | talk_lib/tests/testtalk.py | allankellynet/mimas | 10025d43bba9e84f502a266760786842e7158a05 | [
"MIT"
] | null | null | null | talk_lib/tests/testtalk.py | allankellynet/mimas | 10025d43bba9e84f502a266760786842e7158a05 | [
"MIT"
] | 1 | 2020-02-05T13:00:29.000Z | 2020-02-05T13:00:29.000Z | talk_lib/tests/testtalk.py | allankellynet/mimas | 10025d43bba9e84f502a266760786842e7158a05 | [
"MIT"
] | null | null | null | #-----------------------------------------------------
# Mimas: conference submission and review system
# (c) Allan Kelly 2016-2020 http://www.allankelly.net
# Licensed under MIT License, see LICENSE file
# -----------------------------------------------------
import unittest
from google.appengine.ext import testbed
... | 29.775701 | 73 | 0.605775 |
import unittest
from google.appengine.ext import testbed
from speaker_lib import speaker
from talk_lib import talk
class TestTalk(unittest.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
self.testbed... | true | true |
f71f4d609651d9bc64373e010c165faa55a5f9cf | 3,278 | py | Python | beyond_tutorial/settings.py | shlior7/beyond-tutorial | 502618b125e9a81d334683b845b248fd750abc77 | [
"MIT"
] | null | null | null | beyond_tutorial/settings.py | shlior7/beyond-tutorial | 502618b125e9a81d334683b845b248fd750abc77 | [
"MIT"
] | null | null | null | beyond_tutorial/settings.py | shlior7/beyond-tutorial | 502618b125e9a81d334683b845b248fd750abc77 | [
"MIT"
] | null | null | null | """
Django settings for beyond_tutorial project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from... | 27.546218 | 91 | 0.705613 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-s$+txx&pz8eeh$_+wbakb!i+1o%9ijf*=n0e6=k4d^ix_kfv7d'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib... | true | true |
f71f4d8ff46ec6e4a8d5c7681ef34b9994b20203 | 13,826 | py | Python | xltable/expression.py | fkarb/xltable | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | [
"MIT"
] | 4 | 2017-03-09T20:04:35.000Z | 2020-01-18T16:24:33.000Z | xltable/expression.py | fkarb/xltable | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | [
"MIT"
] | 6 | 2017-12-05T13:22:10.000Z | 2018-01-29T13:50:27.000Z | xltable/expression.py | fkarb/xltable | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | [
"MIT"
] | 6 | 2017-10-26T16:44:27.000Z | 2021-08-16T19:39:21.000Z | """
Expressions for building excel formulas without having to use concrete positions.
"""
import operator
import re
class Expression(object):
"""
Base class for all worksheet expressions.
Expressions are used to build formulas referencing ranges in the
worksheet by labels which are resolved to cell r... | 36.67374 | 106 | 0.607913 | import operator
import re
class Expression(object):
def __init__(self, value=None):
if value is not None:
self.value = value
def __add__(self, other):
return BinOp(self, _make_expr(other), "+")
def __sub__(self, other):
return BinOp(self, _make_expr(other), "-")
... | true | true |
f71f4dd1d3b032910ffb279d50397befdfd25e03 | 4,066 | py | Python | benchmark/startQiskit_noisy2042.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2042.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2042.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=36
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.457627 | 140 | 0.65396 |
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
im... | true | true |
f71f4e31ae0227fac2aaa54777be8a7905234464 | 4,056 | py | Python | code/edgesense copy/python/tutorial.py | albertocottica/microfoundations-community-management | d18e902a431213ed8a464ce92424e9a078f8f9e6 | [
"MIT"
] | 2 | 2020-04-08T20:47:42.000Z | 2020-08-24T08:29:42.000Z | code/edgesense copy/python/tutorial.py | albertocottica/microfoundations-community-management | d18e902a431213ed8a464ce92424e9a078f8f9e6 | [
"MIT"
] | null | null | null | code/edgesense copy/python/tutorial.py | albertocottica/microfoundations-community-management | d18e902a431213ed8a464ce92424e9a078f8f9e6 | [
"MIT"
] | 1 | 2020-05-10T15:06:24.000Z | 2020-05-10T15:06:24.000Z | # This program rearranges raw Egderyders data and builds two lists of dicts, userlist and ciommentslist, containing
# of the data needed to buildm graphs. These objects are then saved into files.
import os, sys
import json
import csv
from datetime import datetime
import time
import logging
import re
from edgesense.ut... | 35.578947 | 116 | 0.568787 |
import os, sys
import json
import csv
from datetime import datetime
import time
import logging
import re
from edgesense.utils.logger_initializer import initialize_logger
from edgesense.utils.resource import mkdir
def parse_options(argv):
import getopt
basepath = '.'
timestamp = datetime.now()
... | false | true |
f71f513fecec1a24f3bc3562ef0e4939b4598d59 | 604 | py | Python | discord_styler/__init__.py | miaowware/discord-styled-text | 9e02375b0ba947628bf7a7c853efc433f74d9373 | [
"BSD-3-Clause"
] | 1 | 2022-01-23T23:26:53.000Z | 2022-01-23T23:26:53.000Z | discord_styler/__init__.py | miaowware/discord-styled-text | 9e02375b0ba947628bf7a7c853efc433f74d9373 | [
"BSD-3-Clause"
] | 3 | 2021-08-28T01:46:36.000Z | 2021-09-07T02:59:03.000Z | discord_styler/__init__.py | miaowware/discord-styled-text | 9e02375b0ba947628bf7a7c853efc433f74d9373 | [
"BSD-3-Clause"
] | null | null | null | """
discord-styled-text
---
A small library to style text for Discord without having to remember any syntax
Copyright 2021 classabbyamp, 0x5c
Released under the terms of the BSD 3-Clause license.
"""
from .__info__ import __version__
from .styler import StyledText, Italic, Bold, Underline, Strikethrough, InlineCode,... | 33.555556 | 103 | 0.816225 |
from .__info__ import __version__
from .styler import StyledText, Italic, Bold, Underline, Strikethrough, InlineCode, Spoiler, BlockQuote
from .styler import CodeBlock
from .styler import TitledURL, NonEmbeddingURL
from .styler import MentionABC, UserMention, RoleMention, ChannelMention
from .styler import TimeStyle,... | true | true |
f71f51b989d608434d95424eaab6a007063a211a | 27,424 | py | Python | Multiagent/pacman.py | zengziyunthomas/Artifical-Intelligence | 4862a65bc8743e89b3c92d94eeca973f8b1851f3 | [
"MIT"
] | 1 | 2022-01-07T08:03:55.000Z | 2022-01-07T08:03:55.000Z | Multiagent/pacman.py | zengziyunthomas/Artifical-Intelligence | 4862a65bc8743e89b3c92d94eeca973f8b1851f3 | [
"MIT"
] | null | null | null | Multiagent/pacman.py | zengziyunthomas/Artifical-Intelligence | 4862a65bc8743e89b3c92d94eeca973f8b1851f3 | [
"MIT"
] | null | null | null | # pacman.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
... | 37.109608 | 120 | 0.592656 |
from game import GameStateData
from game import Game
from game import Directions
from game import Actions
from util import nearestPoint
from util import manhattanDistance
import util
import layout
import sys
import types
import time
import random
import os
imer = staticmethod(decrementTim... | true | true |
f71f51cf95ba54a5f6398ad0ae300442232506f4 | 3,554 | py | Python | examples/Yellow_Sea/make_YELLOW_grd_v1.py | bilgetutak/pyroms | 3b0550f26f4ac181b7812e14a7167cd1ca0797f0 | [
"BSD-3-Clause"
] | 75 | 2016-04-05T07:15:57.000Z | 2022-03-04T22:49:54.000Z | examples/Yellow_Sea/make_YELLOW_grd_v1.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 27 | 2017-02-26T04:27:49.000Z | 2021-12-01T17:26:56.000Z | examples/Yellow_Sea/make_YELLOW_grd_v1.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 56 | 2016-05-11T06:19:14.000Z | 2022-03-22T19:04:17.000Z | import os
from pyroms import _iso
import numpy as np
from mpl_toolkits.basemap import Basemap, shiftgrid
from scipy.interpolate import griddata
import matplotlib.colors as colors
from scipy.signal import medfilt2d
import netCDF4
import pyroms
from bathy_smoother import *
# Grid dimension
Lm = 140
Mm = 120
lon0=117.5... | 29.865546 | 98 | 0.728475 | import os
from pyroms import _iso
import numpy as np
from mpl_toolkits.basemap import Basemap, shiftgrid
from scipy.interpolate import griddata
import matplotlib.colors as colors
from scipy.signal import medfilt2d
import netCDF4
import pyroms
from bathy_smoother import *
Lm = 140
Mm = 120
lon0=117.5 ; lat0 = 41.
lo... | true | true |
f71f51f2b02de08ee56c301cd81086d983759417 | 4,082 | py | Python | tests/config/test_config_provider.py | sturmianseq/thundra-agent-python | 4cee02d790eb7b8e4dea4e2e9dcd1f67533b1c56 | [
"Apache-2.0"
] | 22 | 2018-03-05T20:02:46.000Z | 2021-04-09T12:00:18.000Z | tests/config/test_config_provider.py | sturmianseq/thundra-agent-python | 4cee02d790eb7b8e4dea4e2e9dcd1f67533b1c56 | [
"Apache-2.0"
] | 13 | 2018-03-26T07:57:57.000Z | 2021-06-29T14:22:52.000Z | tests/config/test_config_provider.py | thundra-io/thundra-agent-python | 448e18c17d8730c381b2e2a773782cf80c5a7cfb | [
"Apache-2.0"
] | 3 | 2021-08-07T14:19:23.000Z | 2021-12-08T15:35:40.000Z | import os
import pytest
from thundra.config.config_provider import ConfigProvider
@pytest.fixture()
def config_options():
return {
'config': {
'my': {
'key': 'my-value'
},
'lambda': {
'my': {
'key2': 'my-value2'
... | 34.888889 | 114 | 0.629838 | import os
import pytest
from thundra.config.config_provider import ConfigProvider
@pytest.fixture()
def config_options():
return {
'config': {
'my': {
'key': 'my-value'
},
'lambda': {
'my': {
'key2': 'my-value2'
... | true | true |
f71f521b683a7942f71c9124e2203f4da258ee2b | 4,799 | py | Python | tests/test_optimalK.py | alinaselega/gap_statistic | 2b94c46b676eef839f7709441a89bdc5796b2d31 | [
"MIT",
"Unlicense"
] | 132 | 2016-11-01T07:08:21.000Z | 2022-03-30T13:41:31.000Z | tests/test_optimalK.py | alinaselega/gap_statistic | 2b94c46b676eef839f7709441a89bdc5796b2d31 | [
"MIT",
"Unlicense"
] | 37 | 2016-10-18T12:18:35.000Z | 2022-02-23T04:22:19.000Z | tests/test_optimalK.py | alinaselega/gap_statistic | 2b94c46b676eef839f7709441a89bdc5796b2d31 | [
"MIT",
"Unlicense"
] | 43 | 2017-01-08T18:35:45.000Z | 2022-02-17T14:07:20.000Z | # -*- coding: utf-8 -*-
import os
import pytest
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans, MeanShift
from gap_statistic import OptimalK
def test_bad_init_config():
"""
Cannot define own clustering function and try to use Rust backend
"""
with pytes... | 29.441718 | 87 | 0.681184 |
import os
import pytest
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans, MeanShift
from gap_statistic import OptimalK
def test_bad_init_config():
with pytest.raises(ValueError):
OptimalK(parallel_backend="rust", clusterer=lambda x, k: print("just testing"))... | true | true |
f71f533ceeca3968a0d37a1a87b62202c911fd86 | 11,743 | py | Python | samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-01-24T08:22:21.000Z | 2022-01-24T08:22:21.000Z | samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 4 | 2021-09-29T08:46:32.000Z | 2021-12-08T09:07:04.000Z | samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py | JigarJoshi/openapi-generator | 785535b8d6881b358463994823abbda2b26ff42e | [
"Apache-2.0"
] | 1 | 2022-02-24T15:54:44.000Z | 2022-02-24T15:54:44.000Z | """
OpenAPI Extension with dynamic servers
This specification shows how to use dynamic servers. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from dynamic_servers.api_client import ApiClient... | 37.044164 | 106 | 0.471941 |
import re
import sys
from dynamic_servers.api_client import ApiClient, Endpoint as _Endpoint
from dynamic_servers.model_utils import (
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
class UsageApi(object):
def __ini... | true | true |
f71f537b15779a901376e8b188dd9b2dd1be6031 | 1,525 | py | Python | scripts/cleanup_datasets/update_dataset_size.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | scripts/cleanup_datasets/update_dataset_size.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | scripts/cleanup_datasets/update_dataset_size.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
"""
Updates dataset.size column.
Remember to backup your database before running.
"""
import sys, os, ConfigParser
import galaxy.app
assert sys.version_info[:2] >= ( 2, 4 )
def usage(prog) :
print "usage: %s galaxy.ini" % prog
print """
Updates the dataset.size column. Users are advised... | 33.888889 | 118 | 0.649836 |
"""
Updates dataset.size column.
Remember to backup your database before running.
"""
import sys, os, ConfigParser
import galaxy.app
assert sys.version_info[:2] >= ( 2, 4 )
def usage(prog) :
print "usage: %s galaxy.ini" % prog
print """
Updates the dataset.size column. Users are advised to backup the databa... | false | true |
f71f5536fde4ae2ab6e7c0ba9feffb7cea1900eb | 37,453 | py | Python | src/base/android/jni_generator/jni_generator.py | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | 9 | 2018-09-21T05:36:12.000Z | 2021-11-15T15:14:36.000Z | base/android/jni_generator/jni_generator.py | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | base/android/jni_generator/jni_generator.py | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2018-11-28T14:54:13.000Z | 2020-07-02T07:36:07.000Z | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""... | 36.256534 | 80 | 0.637893 |
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""
import collections
import errno
import optparse
import os
import re
import string
from string import Template
import subprocess
import sys
import textwrap
import zipfile
class Pars... | false | true |
f71f559efb8f3cc65c106ea9756849f94c18c509 | 1,170 | py | Python | test/test_main.py | LucaMarconato/phyper | 065f41dbdce93b95cd2f8a16ad72a1cf57826c66 | [
"MIT"
] | 1 | 2020-08-14T07:40:18.000Z | 2020-08-14T07:40:18.000Z | test/test_main.py | LucaMarconato/phyper | 065f41dbdce93b95cd2f8a16ad72a1cf57826c66 | [
"MIT"
] | null | null | null | test/test_main.py | LucaMarconato/phyper | 065f41dbdce93b95cd2f8a16ad72a1cf57826c66 | [
"MIT"
] | null | null | null | import phyper
from typing import List
from pprint import pprint
import pandas as pd
class NonKeys:
n_epochs = 11
batch_size = 10
resume_training = False
another_non_key = True
class MyParser(phyper.Parser, NonKeys):
my_testa: str = 1
ehi = None
bbbbb = 32
c = 'ehi'
hashed_resources... | 27.857143 | 93 | 0.766667 | import phyper
from typing import List
from pprint import pprint
import pandas as pd
class NonKeys:
n_epochs = 11
batch_size = 10
resume_training = False
another_non_key = True
class MyParser(phyper.Parser, NonKeys):
my_testa: str = 1
ehi = None
bbbbb = 32
c = 'ehi'
hashed_resources... | true | true |
f71f55c54252740d7984c8598467133969e771fe | 1,091 | py | Python | motion_primitives_py/motion_primitives_py/examples/dispersion_algorithm_animation.py | ljarin/dispersion_motion_planning | 1c16c95b70915e58e407c1a45aa4065877fbb3de | [
"BSD-3-Clause"
] | 1 | 2022-03-04T12:03:26.000Z | 2022-03-04T12:03:26.000Z | motion_primitives_py/motion_primitives_py/examples/dispersion_algorithm_animation.py | ljarin/dispersion_motion_planning | 1c16c95b70915e58e407c1a45aa4065877fbb3de | [
"BSD-3-Clause"
] | null | null | null | motion_primitives_py/motion_primitives_py/examples/dispersion_algorithm_animation.py | ljarin/dispersion_motion_planning | 1c16c95b70915e58e407c1a45aa4065877fbb3de | [
"BSD-3-Clause"
] | null | null | null | # %%
from motion_primitives_py import *
import numpy as np
import time
from pycallgraph import PyCallGraph, Config
from pycallgraph.output import GraphvizOutput
"""
Animate the evolution of the min. dispersion algorithm
"""
tiling = True
plot = False
animate = True
check_backwards_dispersion = False
mp_subclass_specif... | 27.974359 | 131 | 0.781852 |
from motion_primitives_py import *
import numpy as np
import time
from pycallgraph import PyCallGraph, Config
from pycallgraph.output import GraphvizOutput
tiling = True
plot = False
animate = True
check_backwards_dispersion = False
mp_subclass_specific_data = {}
control_space_q = 2
num_dims = 2
max_state = [3.5, ... | true | true |
f71f55f7dda83299229f1c6bd846bc4c7c0d3162 | 4,502 | py | Python | apps/beeswax/src/beeswax/hive_site.py | thinker0/hue | ee5aecc3db442e962584d3151c0f2eab397d6707 | [
"Apache-2.0"
] | null | null | null | apps/beeswax/src/beeswax/hive_site.py | thinker0/hue | ee5aecc3db442e962584d3151c0f2eab397d6707 | [
"Apache-2.0"
] | null | null | null | apps/beeswax/src/beeswax/hive_site.py | thinker0/hue | ee5aecc3db442e962584d3151c0f2eab397d6707 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 31.263889 | 126 | 0.734118 |
"""
Helper for reading hive-site.xml
"""
import errno
import logging
import os.path
import re
import socket
from desktop.lib import security_util
from hadoop import confparse
import beeswax.conf
LOG = logging.getLogger(__name__)
_HIVE_SITE_PATH = None
_HIVE_SITE_DICT = None ... | false | true |
f71f573d416e2f35d92d643b1b9835d4b1c1c202 | 13,297 | py | Python | KiBuzzard/buzzard/modules/svgstring2path.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | KiBuzzard/buzzard/modules/svgstring2path.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | KiBuzzard/buzzard/modules/svgstring2path.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | # This is a conglomeration of modules removed from https://github.com/mathandy/svgpathtools
# in order to support a modified 'svg2paths' method called 'string2paths' which takes an
# svg string as an argument instead of a filename.
from svgpathtools import Line, QuadraticBezier, CubicBezier, Path, Arc
from xml.dom.mi... | 36.53022 | 113 | 0.582011 |
from svgpathtools import Line, QuadraticBezier, CubicBezier, Path, Arc
from xml.dom.minidom import parseString
import warnings
import re
try:
str = basestring
except NameError:
pass
COMMANDS = set('MmZzLlHhVvCcSsQqTtAa')
UPPERCASE = set('MZLHVCSQTA')
COMMAND_RE = re.compile("([MmZzLlHhVvCcSsQqTtAa])")
FLO... | true | true |
f71f58007a0c5588589b9d561d48fa13ca605a79 | 4,663 | py | Python | parser/fase2/team22/Instrucciones/Sql_alter/AlterTableAddColumn.py | LopDlMa/tytus | 0b43ee1c7300cb11ddbe593e08239321b71dc443 | [
"MIT"
] | null | null | null | parser/fase2/team22/Instrucciones/Sql_alter/AlterTableAddColumn.py | LopDlMa/tytus | 0b43ee1c7300cb11ddbe593e08239321b71dc443 | [
"MIT"
] | null | null | null | parser/fase2/team22/Instrucciones/Sql_alter/AlterTableAddColumn.py | LopDlMa/tytus | 0b43ee1c7300cb11ddbe593e08239321b71dc443 | [
"MIT"
] | null | null | null | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
import collections
from storageManager.jsonMode import *
from Optimizador.C3D import *
from Instrucciones.TablaSimbolos import Instruccion3D as c3d
class AlterTableAddColumn(Instruccion):
def __init__(self... | 51.811111 | 162 | 0.5638 | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
import collections
from storageManager.jsonMode import *
from Optimizador.C3D import *
from Instrucciones.TablaSimbolos import Instruccion3D as c3d
class AlterTableAddColumn(Instruccion):
def __init__(self... | true | true |
f71f5818bd5e30abb2dd28facc28beb49f2ea0f1 | 1,726 | py | Python | my_methods/my_cap_curve.py | noushadkhan01/my_methods | fc467d5c34b9b5dd105e32cc5aad218d3f6408a8 | [
"MIT"
] | null | null | null | my_methods/my_cap_curve.py | noushadkhan01/my_methods | fc467d5c34b9b5dd105e32cc5aad218d3f6408a8 | [
"MIT"
] | null | null | null | my_methods/my_cap_curve.py | noushadkhan01/my_methods | fc467d5c34b9b5dd105e32cc5aad218d3f6408a8 | [
"MIT"
] | null | null | null | def my_cap_curve(model, X, y, figsize = (10, 5),legend_font_size = 10,loc = 'best',
linewidth = 2,label_font_size = 10, poly_features = False, extra_name = None):
import matplotlib.pyplot as plt
import numpy as np
import my_global_variables
from sklearn.metrics import roc_curve, auc
class_nam... | 45.421053 | 132 | 0.695829 | def my_cap_curve(model, X, y, figsize = (10, 5),legend_font_size = 10,loc = 'best',
linewidth = 2,label_font_size = 10, poly_features = False, extra_name = None):
import matplotlib.pyplot as plt
import numpy as np
import my_global_variables
from sklearn.metrics import roc_curve, auc
class_nam... | true | true |
f71f5879feebeaca94821aab1a4522d364bde04b | 2,130 | py | Python | tests/test_setutils.py | acatton/fork--mahmoud--boltons | 8916c66121cdbbe2bfc365152d5c202096a0ad16 | [
"BSD-3-Clause"
] | 1 | 2017-05-08T17:42:01.000Z | 2017-05-08T17:42:01.000Z | tests/test_setutils.py | acatton/fork--mahmoud--boltons | 8916c66121cdbbe2bfc365152d5c202096a0ad16 | [
"BSD-3-Clause"
] | 16 | 2018-10-15T10:07:36.000Z | 2019-01-07T04:34:34.000Z | tests/test_setutils.py | r0flc0pt4/boltons | 96bd42b5cca2a8783079430b94f9930b764573e9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from boltons.setutils import IndexedSet, _MISSING
def test_indexed_set_basic():
zero2nine = IndexedSet(range(10))
five2nine = zero2nine & IndexedSet(range(5, 15))
x = IndexedSet(five2nine)
x |= set([10])
assert list(zero2nine) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
assert ... | 30.869565 | 68 | 0.585915 |
from boltons.setutils import IndexedSet, _MISSING
def test_indexed_set_basic():
zero2nine = IndexedSet(range(10))
five2nine = zero2nine & IndexedSet(range(5, 15))
x = IndexedSet(five2nine)
x |= set([10])
assert list(zero2nine) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
assert set(zero2nine) == set([... | true | true |
f71f588ae8e89518a40ae039426b0803c80db5e6 | 27,740 | py | Python | dask/array/top.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | 1 | 2019-05-24T00:46:48.000Z | 2019-05-24T00:46:48.000Z | dask/array/top.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | null | null | null | dask/array/top.py | migueltorrescosta/dask | 60f488cf7358d14c523f84de9afbb10022818367 | [
"BSD-3-Clause"
] | null | null | null | import itertools
import numbers
import numpy as np
import toolz
from .. import base, core, sharedict, utils
from ..compatibility import apply, Mapping
from ..delayed import to_task_dask
from ..optimization import SubgraphCallable
def subs(task, substitution):
""" Create a new task with the values substituted
... | 36.308901 | 107 | 0.548594 | import itertools
import numbers
import numpy as np
import toolz
from .. import base, core, sharedict, utils
from ..compatibility import apply, Mapping
from ..delayed import to_task_dask
from ..optimization import SubgraphCallable
def subs(task, substitution):
if isinstance(task, dict):
return {k: subs(v... | true | true |
f71f58c1649fd2690611e738744d6c22a955fdf0 | 4,419 | py | Python | sherpa_client/models/http_service_metadata.py | kairntech/sherpa-client | cd259c87b7291eeec3f3ea025e368f2f069a06cd | [
"Apache-2.0"
] | null | null | null | sherpa_client/models/http_service_metadata.py | kairntech/sherpa-client | cd259c87b7291eeec3f3ea025e368f2f069a06cd | [
"Apache-2.0"
] | null | null | null | sherpa_client/models/http_service_metadata.py | kairntech/sherpa-client | cd259c87b7291eeec3f3ea025e368f2f069a06cd | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..models.http_service_metadata_operations import HttpServiceMetadataOperations
from ..types import UNSET, Unset
T = TypeVar("T", bound="HttpServiceMetadata")
@attr.s(auto_attribs=True)
class HttpServiceMetadata:
""" """
api: str
compa... | 30.902098 | 83 | 0.604435 | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..models.http_service_metadata_operations import HttpServiceMetadataOperations
from ..types import UNSET, Unset
T = TypeVar("T", bound="HttpServiceMetadata")
@attr.s(auto_attribs=True)
class HttpServiceMetadata:
api: str
compatibility: st... | true | true |
f71f5c880c576a98b3a2c7865445d8aef1babbe3 | 5,734 | py | Python | ivy/func_wrapper.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | 1 | 2022-02-15T02:07:07.000Z | 2022-02-15T02:07:07.000Z | ivy/func_wrapper.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | null | null | null | ivy/func_wrapper.py | sert121/ivy | 286f86e487b0c83d46a3ef8d30aa96316337db32 | [
"Apache-2.0"
] | null | null | null | import ivy
import inspect
import importlib
import numpy as np
from types import ModuleType
wrapped_modules_n_classes = []
NON_WRAPPED_METHODS = ['current_framework', 'current_framework_str', 'set_framework', 'get_framework',
'unset_framework', 'set_debug_mode', 'set_breakpoint_debug_mode', 'set... | 40.380282 | 117 | 0.592431 | import ivy
import inspect
import importlib
import numpy as np
from types import ModuleType
wrapped_modules_n_classes = []
NON_WRAPPED_METHODS = ['current_framework', 'current_framework_str', 'set_framework', 'get_framework',
'unset_framework', 'set_debug_mode', 'set_breakpoint_debug_mode', 'set... | true | true |
f71f5cbb0f82e3b460895dc04351f46514cc35da | 1,549 | py | Python | idb/client/pid_saver.py | fakeNetflix/facebook-repo-idb | eb4ed5a7dc4a14b224a22e833294d7366fe4725e | [
"MIT"
] | 1 | 2021-03-09T07:29:18.000Z | 2021-03-09T07:29:18.000Z | idb/client/pid_saver.py | fakeNetflix/facebook-repo-idb | eb4ed5a7dc4a14b224a22e833294d7366fe4725e | [
"MIT"
] | 6 | 2021-05-10T08:32:56.000Z | 2022-02-26T01:41:09.000Z | idb/client/pid_saver.py | fakeNetflix/facebook-repo-idb | eb4ed5a7dc4a14b224a22e833294d7366fe4725e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import json
import logging
import os
import signal
from typing import List
from idb.common.constants import IDB_PID_PATH
def save_pid(pid: int) -> None:
pids = _get_pids()
pids.append(pid)
_write_pids(pids=pid... | 23.469697 | 71 | 0.632666 |
import json
import logging
import os
import signal
from typing import List
from idb.common.constants import IDB_PID_PATH
def save_pid(pid: int) -> None:
pids = _get_pids()
pids.append(pid)
_write_pids(pids=pids)
logging.debug(f"saved daemon pid {pid}")
def remove_pid(pid: int) -> None:
pids ... | true | true |
f71f5d1fb7366ad5808529f520d04d12bd1805b1 | 12,476 | py | Python | bot/bot.py | mudkipdev/pydis-bot | 234fba49e039fc4c5c8421162e803b1be3d0d33c | [
"MIT",
"BSD-3-Clause"
] | null | null | null | bot/bot.py | mudkipdev/pydis-bot | 234fba49e039fc4c5c8421162e803b1be3d0d33c | [
"MIT",
"BSD-3-Clause"
] | null | null | null | bot/bot.py | mudkipdev/pydis-bot | 234fba49e039fc4c5c8421162e803b1be3d0d33c | [
"MIT",
"BSD-3-Clause"
] | null | null | null | import asyncio
import logging
import socket
import warnings
from collections import defaultdict
from typing import Dict, Optional
import aiohttp
import discord
from async_rediscache import RedisSession
from discord.ext import commands
from sentry_sdk import push_scope
from bot import api, constants
from bot.async_sta... | 38.152905 | 107 | 0.64083 | import asyncio
import logging
import socket
import warnings
from collections import defaultdict
from typing import Dict, Optional
import aiohttp
import discord
from async_rediscache import RedisSession
from discord.ext import commands
from sentry_sdk import push_scope
from bot import api, constants
from bot.async_sta... | true | true |
f71f5dc2484d87171414c6d905bc5a1656c3625b | 4,043 | py | Python | encoders/audio/Wav2VecSpeechEncoder/__init__.py | akurniawan/jina-hub | d89bc5e8f527f1212c3228a15775e222983c0087 | [
"Apache-2.0"
] | null | null | null | encoders/audio/Wav2VecSpeechEncoder/__init__.py | akurniawan/jina-hub | d89bc5e8f527f1212c3228a15775e222983c0087 | [
"Apache-2.0"
] | null | null | null | encoders/audio/Wav2VecSpeechEncoder/__init__.py | akurniawan/jina-hub | d89bc5e8f527f1212c3228a15775e222983c0087 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from typing import Optional
import numpy as np
from jina.executors.decorators import batching, as_ndarray
from jina.executors.encoders import BaseAudioEncoder
from jina.executors.encoders.frameworks import... | 40.838384 | 95 | 0.666337 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from typing import Optional
import numpy as np
from jina.executors.decorators import batching, as_ndarray
from jina.executors.encoders import BaseAudioEncoder
from jina.executors.encoders.frameworks import... | true | true |
f71f5e67663079678fe379004ccba2d635f29cd6 | 3,572 | py | Python | cp_spider/cp_spider/settings.py | zachariah-chow/mas-cp-scrapy | 7c3cd8bcb9d6fc248a325621337da40398452cdb | [
"MIT"
] | null | null | null | cp_spider/cp_spider/settings.py | zachariah-chow/mas-cp-scrapy | 7c3cd8bcb9d6fc248a325621337da40398452cdb | [
"MIT"
] | null | null | null | cp_spider/cp_spider/settings.py | zachariah-chow/mas-cp-scrapy | 7c3cd8bcb9d6fc248a325621337da40398452cdb | [
"MIT"
] | null | null | null | # Scrapy settings for cp_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middlewa... | 33.698113 | 103 | 0.779395 |
BOT_NAME = 'cp_spider'
SPIDER_MODULES = ['cp_spider.spiders']
NEWSPIDER_MODULE = 'cp_spider.spiders'
ROBOTSTXT_OBEY = False
ocalhost:8050'
DOWNLOADER_MIDDLEWARES = {
'scrapy_splash.SplashCookiesMiddleware': 723,
'scrapy_splash.SplashMiddleware': 72... | true | true |
f71f5e75839cd04c172644fd22b384312e83d690 | 6,499 | py | Python | grid_world.py | vigneshyaadav27/Grid-world | a5c4cab46cdafc6458526593ae31ac19a152001d | [
"MIT"
] | null | null | null | grid_world.py | vigneshyaadav27/Grid-world | a5c4cab46cdafc6458526593ae31ac19a152001d | [
"MIT"
] | null | null | null | grid_world.py | vigneshyaadav27/Grid-world | a5c4cab46cdafc6458526593ae31ac19a152001d | [
"MIT"
] | null | null | null | #######################################################################
# Copyright (C) #
# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# 2016 Kenta Shimada(hyperkentakun@gmail.com) #
# Permission given to modify... | 33.158163 | 109 | 0.507617 | 4:
draw_image(np.round(new_value, decimals=2))
plt.savefig('../images/figure_3_5.png')
plt.close()
draw_policy(new_value)
plt.savefig('../images/figure_3_5_policy.png')
plt.close()
break
value = new_value
if __name_... | true | true |
f71f5f797ad336b6fedd52f0f7c38c754c946db7 | 245 | py | Python | mundo 2/aula 12/exer38.py | jonatan098/cursopython | 6e4cbaef6229e230fdbc66d80ec1b5a089887b0d | [
"MIT"
] | null | null | null | mundo 2/aula 12/exer38.py | jonatan098/cursopython | 6e4cbaef6229e230fdbc66d80ec1b5a089887b0d | [
"MIT"
] | null | null | null | mundo 2/aula 12/exer38.py | jonatan098/cursopython | 6e4cbaef6229e230fdbc66d80ec1b5a089887b0d | [
"MIT"
] | 1 | 2020-02-22T17:21:05.000Z | 2020-02-22T17:21:05.000Z | num1 = int(input('digite o primeiro valor: '))
num2 = int(input('digite o segundo valor: '))
if num1 > num2:
print('o primeiro numero e maior')
elif num2 > num1:
print('o segundo numero e maior')
else:
print('os numeros são iguais')
| 27.222222 | 46 | 0.665306 | num1 = int(input('digite o primeiro valor: '))
num2 = int(input('digite o segundo valor: '))
if num1 > num2:
print('o primeiro numero e maior')
elif num2 > num1:
print('o segundo numero e maior')
else:
print('os numeros são iguais')
| true | true |
f71f603e3e2b9119bf19c27949a553a350de4dbb | 3,576 | py | Python | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | 4 | 2020-02-06T01:10:13.000Z | 2021-12-11T01:06:10.000Z | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | 30 | 2020-02-03T23:54:10.000Z | 2022-03-18T18:50:31.000Z | nowcast/workers/ping_erddap.py | SalishSeaCast/SalishSeaNowcast | 947ba6fbb8952c7ae989a3aa96614b900748f55d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2021 The Salish Sea MEOPAR contributors
# and The University of British Columbia
#
# 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/... | 33.420561 | 85 | 0.661074 |
import logging
from pathlib import Path
from nemo_nowcast import NowcastWorker
NAME = "ping_erddap"
logger = logging.getLogger(NAME)
def main():
worker = NowcastWorker(NAME, description=__doc__)
worker.init_cli()
worker.cli.add_argument(
"dataset",
choices={
"we... | true | true |
f71f6077b391c331cf27b94831a1bdac9c70c7a6 | 1,120 | py | Python | Numbers/Key/happy_numbers.py | CicadaMikoto/Projects | ccc3de5184a8dc9fcd108c3ddbe6fd72d6aa380a | [
"MIT"
] | 1 | 2021-01-22T07:50:30.000Z | 2021-01-22T07:50:30.000Z | Numbers/Key/happy_numbers.py | CicadaMikoto/Projects | ccc3de5184a8dc9fcd108c3ddbe6fd72d6aa380a | [
"MIT"
] | null | null | null | Numbers/Key/happy_numbers.py | CicadaMikoto/Projects | ccc3de5184a8dc9fcd108c3ddbe6fd72d6aa380a | [
"MIT"
] | null | null | null | """
Happy Numbers - A happy number is defined by the
following process. Starting with any positive integer,
replace the number by the sum of the squares of its
digits, and repeat the process until the number equals
1 (where it will stay), or it loops endlessly in a
cycle which does not include 1. Those numbers for whic... | 27.317073 | 63 | 0.658036 | """
Happy Numbers - A happy number is defined by the
following process. Starting with any positive integer,
replace the number by the sum of the squares of its
digits, and repeat the process until the number equals
1 (where it will stay), or it loops endlessly in a
cycle which does not include 1. Those numbers for whic... | false | true |
f71f61276a4576ec17d6d55cf5e8e0be9bdbeab7 | 918 | py | Python | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | 2 | 2019-02-15T09:19:44.000Z | 2019-02-15T09:21:01.000Z | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | null | null | null | FILE/file_merge.py | AceCoooool/python-example | 1d0068627210f08d31f027b6a333118d9f743956 | [
"MIT"
] | null | null | null | import os
import argparse
def file_merge(folder, out_file, ext):
files = [os.path.join(folder, file) for file in os.listdir(folder) if file.endswith(ext)]
with open(out_file, 'w') as f:
for file in files:
with open(file, 'r') as rf:
print('File {} readed.'.format(file))
... | 31.655172 | 93 | 0.61329 | import os
import argparse
def file_merge(folder, out_file, ext):
files = [os.path.join(folder, file) for file in os.listdir(folder) if file.endswith(ext)]
with open(out_file, 'w') as f:
for file in files:
with open(file, 'r') as rf:
print('File {} readed.'.format(file))
... | true | true |
f71f61538bc51d86e628c8573f4d9f8d27add351 | 5,304 | py | Python | ROMS/ROMS_rotate_compare.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 32 | 2015-01-07T01:48:05.000Z | 2022-03-02T07:07:42.000Z | ROMS/ROMS_rotate_compare.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 1 | 2015-04-13T21:00:18.000Z | 2015-04-13T21:00:18.000Z | ROMS/ROMS_rotate_compare.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 30 | 2015-01-28T09:31:29.000Z | 2022-03-07T03:08:28.000Z | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from pylab import *
import netCDF4
# <codecell>
tidx = 0 # just get the final frame, for now.
scale = 0.03
isub = 3
url = 'http://comt.sura.org/thredds/dodsC/comt_2_full/testing/ucsc2.nc'
# <codecell>
def shrink(a,b):
"""Return array shrunk ... | 28.826087 | 98 | 0.575792 |
from pylab import *
import netCDF4
tidx = 0
scale = 0.03
isub = 3
url = 'http://comt.sura.org/thredds/dodsC/comt_2_full/testing/ucsc2.nc'
def shrink(a,b):
"""Return array shrunk to fit a specified shape by triming or averaging.
a = shrink(array, shape)
array is an numpy ndarray, a... | false | true |
f71f61bbd250bef9d676ace26f835628c544adaa | 2,169 | py | Python | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | jaz230/Industrial-IoT | bd4c5abfe579cbb7086a621e8381978e6c70a563 | [
"MIT"
] | 1 | 2020-01-22T12:03:08.000Z | 2020-01-22T12:03:08.000Z | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | api/generated/python/azure-iiot-opc-twin/models/value_write_request_api_model.py | likithadt/Industrial-IoT | d4ea7b330eff08455ca0556fed76aa74d2034da5 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.33.0
# ... | 36.15 | 109 | 0.608575 |
from msrest.serialization import Model
class ValueWriteRequestApiModel(Model):
_validation = {
'value': {'required': True},
}
_attribute_map = {
'node_id': {'key': 'nodeId', 'type': 'str'},
'browse_path': {'key': 'browsePath', 'type': '[str]'},
'value': {'key':... | true | true |
f71f61e720b4ca7b2e7ace2c709ec4297289840e | 130,096 | py | Python | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 1 | 2020-09-10T07:38:20.000Z | 2020-09-10T07:38:20.000Z | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 4 | 2016-05-10T22:05:34.000Z | 2016-05-20T18:10:13.000Z | salt/states/pkg.py | waynegemmell/salt | 88056db3589cccab8956c2ae4f9b733acce89461 | [
"Apache-2.0"
] | 1 | 2020-12-02T01:20:28.000Z | 2020-12-02T01:20:28.000Z | """
Installation of packages using OS package managers such as yum or apt-get
=========================================================================
.. note::
On minions running systemd>=205, as of version 2015.8.12, 2016.3.3, and
2016.11.0, `systemd-run(1)`_ is now used to isolate commands which modify
... | 35.672059 | 116 | 0.563891 |
import fnmatch
import logging
import os
import re
import salt.utils.pkg
import salt.utils.platform
import salt.utils.versions
from salt.exceptions import CommandExecutionError, MinionError, SaltInvocationError
from salt.modules.pkg_resource import _repack_pkgs
from salt.output import nested
from salt.utils.functools... | true | true |
f71f6287f35f2c7ff53b83f6c0121a0e0b75c1ea | 13,549 | py | Python | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | chainer/training/extensions/variable_statistics_plot.py | seiyab/chainer | 39fffb9597a6e9646307fba27ad3233c65d38632 | [
"MIT"
] | null | null | null | from __future__ import division
import os
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.training import extension
from chainer.training import trigger as trigger_module
from chainer.utils import argument
_available = None
def _try... | 36.817935 | 79 | 0.569489 | from __future__ import division
import os
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.training import extension
from chainer.training import trigger as trigger_module
from chainer.utils import argument
_available = None
def _try... | true | true |
f71f62b04af3fdacd6538bdd099ff2935e8e0a14 | 2,893 | py | Python | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | tests/test_param_grid.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | import datetime
from dateutil.relativedelta import relativedelta
import pytest
from ploomber.util import ParamGrid, Interval
def compare(a, b):
for element in a:
if element not in b:
return False
return len(a) == len(b)
def test_interval():
interval = Interval(datetime.date(year=2... | 19.15894 | 71 | 0.407881 | import datetime
from dateutil.relativedelta import relativedelta
import pytest
from ploomber.util import ParamGrid, Interval
def compare(a, b):
for element in a:
if element not in b:
return False
return len(a) == len(b)
def test_interval():
interval = Interval(datetime.date(year=2... | true | true |
f71f63419874a18aec03723ca69a1e11494c93fe | 27 | py | Python | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/NinjaKiwi/LiNK/Lobbies/LatencyMeasurements/StatsExtensions/stats_extensions.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class StatsExtensions: pass | 27 | 27 | 0.888889 | class StatsExtensions: pass | true | true |
f71f638a703961e5577fb4b19745f2c50b5b4f2c | 478 | py | Python | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | Django/SOC2/MyChat/chat/routing.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | from channels import route
from .consumers import ws_connect, ws_receive, ws_disconnect, chat_join, chat_leave, chat_send
websocket_routing = [
route("websocket.connect", ws_connect),
route("websocket.receive", ws_receive),
route("websocket.disconnect", ws_disconnect),
]
custom_routing = [
route("ch... | 29.875 | 94 | 0.717573 | from channels import route
from .consumers import ws_connect, ws_receive, ws_disconnect, chat_join, chat_leave, chat_send
websocket_routing = [
route("websocket.connect", ws_connect),
route("websocket.receive", ws_receive),
route("websocket.disconnect", ws_disconnect),
]
custom_routing = [
route("ch... | true | true |
f71f65dc650c5a613143b036baee3ed96b5449c9 | 5,089 | py | Python | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/audio/VGGISHAudioEncoder/vggish_audio_encoder.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from pathlib import Path
from typing import Any, Optional, List, Iterable
from jina import Executor, requests, DocumentArray
from jina.logging.logger import JinaLogger
import requests as _requests
import te... | 41.373984 | 112 | 0.659658 | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from pathlib import Path
from typing import Any, Optional, List, Iterable
from jina import Executor, requests, DocumentArray
from jina.logging.logger import JinaLogger
import requests as _requests
import te... | true | true |
f71f66195317baeeed07698a274b4377fafe07c5 | 1,436 | py | Python | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOpenPublicSinglearticleDataBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenPublicSinglearticleDataBatchqueryModel(object):
def __init__(self):
self._begin_date = None
self._end_date = None
@property
def begin_date(self):
... | 25.642857 | 71 | 0.601671 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenPublicSinglearticleDataBatchqueryModel(object):
def __init__(self):
self._begin_date = None
self._end_date = None
@property
def begin_date(self):
return self._begin_date
@begin_... | true | true |
f71f668d6fbe52a3a43d82cbb88b941356fc85b3 | 2,366 | py | Python | actstream/runtests/manage.py | inspiration4hunter/django-actstream | 7d655b3bf239c85a6ac804ff72e748214b81bb8e | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:04:59.000Z | 2019-06-27T13:04:59.000Z | actstream/runtests/manage.py | techdragon/django-activity-stream | d5b18470c8682cec3e3db4cfaf8920c3dd33f6bb | [
"BSD-3-Clause"
] | null | null | null | actstream/runtests/manage.py | techdragon/django-activity-stream | d5b18470c8682cec3e3db4cfaf8920c3dd33f6bb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
# https://github.com/tomchristie/django-rest-framework/blob/master/rest... | 30.333333 | 102 | 0.703719 |
import os
import sys
import warnings
warnings.filterwarnings("ignore")
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
os.environ['DJANGO_SETTINGS_MODULE'] = 'actstream.runtests.settings'
engine = os.environ.get('DATABASE_ENGINE', 'django.db.backends.sqlite3')
if engine.... | true | true |
f71f669e87f2e8ea5e0d8ed4ce44947d705ba9d6 | 572 | py | Python | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Factorization Of Numbers/PairFactorization.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | # function to generate list of factors
def get_factorList(n):
# Insert 1 & n in list, if is n == 1 then only add 1
l = list(set([1,n]))
# Iterate to sq.rt. of n to get all factors
for i in range(2, int(n**0.5)+1):
if n%i == 0:
# If i & n/i aree same, then append only one
if i == n//i:
l.append(i)
# ... | 22.88 | 53 | 0.624126 |
def get_factorList(n):
l = list(set([1,n]))
for i in range(2, int(n**0.5)+1):
if n%i == 0:
if i == n//i:
l.append(i)
else:
l.extend([i,n//i])
return l
if __name__ == "__main__":
list_of_numbers = [23, 46, 65, 34234, 423, 43212]
# Get factor list of given no.
for num in list_of_... | true | true |
f71f684248dd8ea778131509570d6005305ece61 | 3,684 | py | Python | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | uwb_channel.py | iguarna/uwb-ieee | 782813b8a6fc9effeb076c47cd5d497b6e62b330 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def gen_channel(parameters, fc=5E9, fs=2E9, dynamic_range=30):
# Calculate samples/nanosec ratio
nanosec_to_samples = int(1E-9 * fs)
#####################################
# Unpack parameters and convert units
cluster_rate = parameters['cluster_r... | 28.55814 | 109 | 0.59392 | import numpy as np
import matplotlib.pyplot as plt
def gen_channel(parameters, fc=5E9, fs=2E9, dynamic_range=30):
nanosec_to_samples = int(1E-9 * fs)
er = np.exp(-t / cluster_decay) * np.random.lognormal(mean=0, sigma=std_cluster_shadowing)
while tau < max_tau:
mean_po... | true | true |
f71f689447e4c38f173ed630b270c2889bd40d14 | 3,032 | py | Python | tottle/exception_factory/error_handler/error_handler.py | muffleo/tottle | 69a5bdda879ab56d43505d517d3369a687c135a2 | [
"MIT"
] | 12 | 2020-09-06T15:31:34.000Z | 2021-02-27T20:30:34.000Z | tottle/exception_factory/error_handler/error_handler.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 2 | 2021-04-13T06:43:42.000Z | 2021-07-07T20:52:39.000Z | tottle/exception_factory/error_handler/error_handler.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 4 | 2020-09-12T03:09:25.000Z | 2021-03-22T08:52:04.000Z | import traceback
import typing
from tottle.exception_factory.error_handler.abc import ABCErrorHandler, ExceptionHandler
from tottle.modules import logger
class ErrorHandler(ABCErrorHandler):
def __init__(self, redirect_arguments: bool = False):
self.error_handlers: typing.Dict[str, ExceptionHandler] = {}... | 34.067416 | 88 | 0.636544 | import traceback
import typing
from tottle.exception_factory.error_handler.abc import ABCErrorHandler, ExceptionHandler
from tottle.modules import logger
class ErrorHandler(ABCErrorHandler):
def __init__(self, redirect_arguments: bool = False):
self.error_handlers: typing.Dict[str, ExceptionHandler] = {}... | true | true |
f71f68f22277399de37d076c657cde17a277ddbd | 70,087 | py | Python | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | androguard/core/analysis/analysis.py | appknox/old-androguard | 8b2fbc262f10f99016f4bbaaac51a963abdb90e4 | [
"Apache-2.0"
] | null | null | null | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... | 32.462714 | 169 | 0.551957 |
import re
import collections
from androguard.core.analysis.sign import Signature, TAINTED_PACKAGE_CREATE, \
TAINTED_PACKAGE_CALL
from androguard.core.androconf import debug, is_ascii_problem,\
load_api_specific_resource_module
from androguard.core.bytecodes import dvm
DVM_FIELDS_ACCESS = {
... | true | true |
f71f68f60efce427cc864118cc7e00210f6bd3bb | 302 | py | Python | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | 1 | 2020-10-08T09:17:40.000Z | 2020-10-08T09:17:40.000Z | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | python3/recent_counter.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | """
space : O(n)
time : O(n)
"""
class RecentCounter:
def __init__(self):
self.history = []
def ping(self, t: int) -> int:
self.history.append(t)
s = t - 3000
while self.history[0] < s:
self.history.pop(0)
return len(self.history)
| 15.1 | 34 | 0.503311 |
class RecentCounter:
def __init__(self):
self.history = []
def ping(self, t: int) -> int:
self.history.append(t)
s = t - 3000
while self.history[0] < s:
self.history.pop(0)
return len(self.history)
| true | true |
f71f694ec80a3bd4c8eb0b4d9cd3f8f8a53b92c1 | 8,293 | py | Python | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"MIT"
] | 1 | 2019-02-10T01:38:05.000Z | 2019-02-10T01:38:05.000Z | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"MIT"
] | null | null | null | knack/invocation.py | derekbekoe/knack | 07ce4c3ae51ef22e6364ed93c5980cae7688e347 | [
"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.
# --------------------------------------------------------------------... | 41.673367 | 119 | 0.636079 |
from __future__ import print_function
import sys
from collections import defaultdict
from .deprecation import ImplicitDeprecated, resolve_deprecate_info
from .util import CLIError, CtxTypeError, CommandResultItem, todict
from .parser import CLICommandParser
from .commands import CLICommandsLoader
from .events i... | true | true |
f71f6972720d1f87a308457a99c2da6ef6fe19d9 | 63,620 | py | Python | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | LeetCode/contest-2018-11-26/fair_candy_swap.py | Max-PJB/python-learning2 | e8b05bef1574ee9abf8c90497e94ef20a7f4e3bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/26 19:28
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
---------------... | 104.638158 | 120 | 0.623546 |
import time
__author__ = 'Max_Pengjb'
start = time.time()
class Solution(object):
def fairCandySwap(self, A, B):
k = (sum(A) - sum(B)) // 2
b = dict(zip(B, [1 for _ in B]))
for i in A:
if i - k in b.keys():
return [i, i - k]
A = [1, 2, 5]
B = [2, 4]
a1 = [... | true | true |
f71f6977583be15f02e5a3484137a80e4aecac84 | 926 | py | Python | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | 1 | 2022-03-09T19:12:22.000Z | 2022-03-09T19:12:22.000Z | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | supervised_learning/0x03-optimization/12-learning_rate_decay.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Learning Rate Decay Upgraded"""
import tensorflow as tf
def learning_rate_decay(alpha, decay_rate, global_step, decay_step):
"""learning_rate_decay: creates a learning rate decay operation in
tensorflow using inverse time decay:
Args:
alpha: is th... | 37.04 | 77 | 0.671706 |
import tensorflow as tf
def learning_rate_decay(alpha, decay_rate, global_step, decay_step):
return tf.train.inverse_time_decay(
learning_rate=alpha, global_step=global_step, decay_steps=decay_step,
decay_rate=decay_rate, staircase=True, name=None
)
| true | true |
f71f6a82759cb768681d3430b292afb226aeca63 | 11,152 | py | Python | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | null | null | null | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | 1 | 2018-08-09T14:13:16.000Z | 2018-08-09T15:34:00.000Z | analyses/weat.py | raphaottoni/youtube-hatespeech | 4467d065c2bddd86feec673ad74670c4c975f017 | [
"MIT"
] | null | null | null | from gensim import corpora, models, similarities
import json
import numpy
import random
import csv
import itertools
import gensim, copy
from collections import defaultdict
import glob, os
target_words = {}
attribute_words= {}
weats_name = []
# 1 WEAT Immigrants
target_words["1_a"] = ["immigrant", "migrant"]
target_wo... | 43.733333 | 148 | 0.598816 | from gensim import corpora, models, similarities
import json
import numpy
import random
import csv
import itertools
import gensim, copy
from collections import defaultdict
import glob, os
target_words = {}
attribute_words= {}
weats_name = []
target_words["1_a"] = ["immigrant", "migrant"]
target_words["1_b"] = ["citi... | true | true |
f71f6c8fd9d986ab03b10daa79ec6a243a174abe | 1,152 | py | Python | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | cgi-bin/utils.py | alexander1389/IMS.WebAPI | cfc8c6c899655c337973f9a32a620e9cd6af34b9 | [
"MIT"
] | null | null | null | from datetime import datetime
def validate_dt(date):
""" Validate datetime string
:param date: The datetime string
:type date: str
:returns: True if the date is correct datetime string,
False otherwise
:rtype: bool
"""
pattern = '000101000000'
# letters in date
if... | 22.588235 | 69 | 0.539063 | from datetime import datetime
def validate_dt(date):
pattern = '000101000000'
if not date.isdecimal():
return False
if len(date) < 2 or len(date) > 12:
return False
if len(date) % 2 > 0:
return False
chk = date + pattern[len(date):]
try:
datetime.... | true | true |
f71f6cf1e351242fc9e0d3e8fd6d87cf389216c6 | 383 | py | Python | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | 1 | 2022-01-13T06:32:10.000Z | 2022-01-13T06:32:10.000Z | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | null | null | null | mitre_attack/data/types/group.py | check-spelling/mitre-attack | f3be1ccff235593c4277f3b9ec2696757924894b | [
"MIT"
] | 1 | 2022-01-14T00:00:24.000Z | 2022-01-14T00:00:24.000Z | from dataclasses import dataclass, field
from typing import List
from mitre_attack import INTRUSION_SET
from mitre_attack.data.types.object import Object
@dataclass(frozen=True)
class Group(Object):
type: str = field(default=INTRUSION_SET, init=False)
name: str
aliases: List[str] = field(default_factory=l... | 29.461538 | 57 | 0.775457 | from dataclasses import dataclass, field
from typing import List
from mitre_attack import INTRUSION_SET
from mitre_attack.data.types.object import Object
@dataclass(frozen=True)
class Group(Object):
type: str = field(default=INTRUSION_SET, init=False)
name: str
aliases: List[str] = field(default_factory=l... | true | true |
f71f6d3f9666a930b13bac187344c124d81e2c1e | 31,993 | py | Python | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | electrum/gui/kivy/uix/dialogs/lightning_channels.py | jacky4566/electrum | f1c2191392780a559ecdc374c81c82191a5d1eb5 | [
"MIT"
] | null | null | null | import asyncio
from typing import TYPE_CHECKING, Optional, Union
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.popup import Popup
from .fee_dialog import FeeDialog
from electrum.util import bh2u
from electrum.logging import Logger
from electrum.lnutil import LOCAL, REMOTE, format_short_... | 37.772137 | 170 | 0.568218 | import asyncio
from typing import TYPE_CHECKING, Optional, Union
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.popup import Popup
from .fee_dialog import FeeDialog
from electrum.util import bh2u
from electrum.logging import Logger
from electrum.lnutil import LOCAL, REMOTE, format_short_... | true | true |
f71f6d9f3398355ffe923f131ddebd4aceaed71f | 8,876 | py | Python | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | forestriveral/floris | 02c31e121283ad6ccae987cfa3aa1bf1e4b43014 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... | 32.512821 | 82 | 0.305994 |
import pytest
def turbines_to_array(turbine_list: list):
return [[t.Ct, t.power, t.aI, t.average_velocity] for t in turbine_list]
def print_test_values(turbine_list: list):
for t in turbine_list:
print(
"({:.7f}, {:.7f}, {:.7f}, {:.7f}),".format(
t.Ct, t.po... | true | true |
f71f6e1acacc2c48f4a28b2d425b5fac6cb232dd | 113,230 | py | Python | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 12 | 2020-12-28T09:40:53.000Z | 2022-03-13T15:36:21.000Z | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 28 | 2021-01-04T14:58:59.000Z | 2022-01-03T03:00:16.000Z | tests/test_class.py | michelp/cxxheaderparser | 83bb2903790cf448bf838cdb8a93ca96e758bd1a | [
"BSD-3-Clause"
] | 1 | 2021-11-06T03:44:53.000Z | 2021-11-06T03:44:53.000Z | # Note: testcases generated via `python -m cxxheaderparser.gentest`
from cxxheaderparser.types import (
AnonymousName,
Array,
BaseClass,
ClassDecl,
EnumDecl,
Enumerator,
Field,
ForwardDecl,
Function,
FundamentalSpecifier,
Method,
MoveReference,
NameSpecifier,
Ope... | 38.240459 | 94 | 0.2641 |
from cxxheaderparser.types import (
AnonymousName,
Array,
BaseClass,
ClassDecl,
EnumDecl,
Enumerator,
Field,
ForwardDecl,
Function,
FundamentalSpecifier,
Method,
MoveReference,
NameSpecifier,
Operator,
PQName,
Parameter,
Pointer,
Reference,
T... | true | true |
f71f6e862b3a393d8f1a1757bbce7092bfb70ae4 | 33,635 | py | Python | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/pack_unique_files_test.py | guiguitodelperuu/demisto-sdk | 3eb0206593bc955a64c6594d717c04e52e254e1d | [
"MIT"
] | null | null | null | import json
import os
import click
import pytest
import requests_mock
from click.testing import CliRunner
from git import GitCommandError
from demisto_sdk.__main__ import main
from demisto_sdk.commands.common import tools
from demisto_sdk.commands.common.constants import (PACK_METADATA_DESC,
... | 43.456072 | 150 | 0.648759 | import json
import os
import click
import pytest
import requests_mock
from click.testing import CliRunner
from git import GitCommandError
from demisto_sdk.__main__ import main
from demisto_sdk.commands.common import tools
from demisto_sdk.commands.common.constants import (PACK_METADATA_DESC,
... | true | true |
f71f6ee079b895d1562283af73f4c7cb38b99b68 | 371 | py | Python | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | src/example02/main.py | luisibanez/cssi-appengine-introduction-01 | 617c27147f8ba91bdecc7b774ccd2d3204607514 | [
"Apache-2.0"
] | null | null | null | import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHan... | 23.1875 | 52 | 0.638814 | import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHan... | true | true |
f71f6f31a5c782d44a541c5b9d96b9cf0320881f | 2,317 | py | Python | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 6 | 2020-02-03T10:29:59.000Z | 2022-03-07T13:24:26.000Z | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 2 | 2020-11-23T03:04:00.000Z | 2021-09-25T00:39:00.000Z | tests/test_json.py | pestun/strace-parser | 8bcddb1670c891785c1fa798b948e9637462c474 | [
"MIT"
] | 2 | 2020-04-23T03:25:04.000Z | 2021-10-21T23:07:21.000Z | from importlib.resources import read_text
import pytest
from lark import Token, Tree
from strace_parser.json_transformer import to_json
from strace_parser.parser import get_parser
from . import data
def assert_fully_serialized(obj):
def _assert_fully_serialized(obj):
assert not isinstance(obj, Tree), o... | 30.893333 | 79 | 0.518774 | from importlib.resources import read_text
import pytest
from lark import Token, Tree
from strace_parser.json_transformer import to_json
from strace_parser.parser import get_parser
from . import data
def assert_fully_serialized(obj):
def _assert_fully_serialized(obj):
assert not isinstance(obj, Tree), o... | true | true |
f71f6f77797715e2642a7242a6f13d06b57a1ac6 | 6,833 | py | Python | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | loops/__init__.py | fenhl/python-loops | ea36e3b1ad68c2257071724a1f760b0e352bb29c | [
"MIT"
] | null | null | null | import datetime
import threading
import time
try:
from loops.version import __version__
except ImportError:
__version__ = None
class IterThread(threading.Thread):
"""Helper class used in loops."""
def __init__(self, iterator):
super().__init__()
self.daemon = True
self.iterator... | 46.80137 | 412 | 0.658861 | import datetime
import threading
import time
try:
from loops.version import __version__
except ImportError:
__version__ = None
class IterThread(threading.Thread):
def __init__(self, iterator):
super().__init__()
self.daemon = True
self.iterator = iterator
self.stopped = Fal... | true | true |
f71f6ffc94e95da06954304971002720ccddd90b | 537 | py | Python | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 3 | 2018-06-03T11:55:28.000Z | 2020-01-03T02:33:22.000Z | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 14 | 2018-05-07T13:33:21.000Z | 2021-04-30T20:46:54.000Z | plugins/yt.py | ctburley/akesho-irc3 | 7d27a45f401ffcfa3a380c7de01687cbe69b874d | [
"MIT"
] | 1 | 2018-06-04T04:45:58.000Z | 2018-06-04T04:45:58.000Z | import irc3
from irc3.plugins.command import command
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
print("yt loaded")
@irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
def yt(self, nick=None, mask=None, channel=None,... | 35.8 | 122 | 0.621974 | import irc3
from irc3.plugins.command import command
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
print("yt loaded")
@irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
def yt(self, nick=None, mask=None, channel=None,... | true | true |
f71f70018ea2bb974a7995e741772da0a860e199 | 11,666 | py | Python | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | mesh_voxel_color/color_pil_cupy.py | naysok/Mesh_Voxel_Color | 9ca3549822ada1be67efcb3e47cf4c193d54cbaa | [
"MIT"
] | null | null | null | import sys
sys.path.append("C:\\Users\\ysoky\\Documents\\Mesh_Voxel_Color\\_module_\\Mesh_Contour")
import math
import cupy as cp
import random
from PIL import Image, ImageDraw, ImageOps, ImageEnhance
from mesh_contour import stl_parser
sp = stl_parser.StlParser()
from .import util
ut = util.Util()... | 27.193473 | 109 | 0.407252 | import sys
sys.path.append("C:\\Users\\ysoky\\Documents\\Mesh_Voxel_Color\\_module_\\Mesh_Contour")
import math
import cupy as cp
import random
from PIL import Image, ImageDraw, ImageOps, ImageEnhance
from mesh_contour import stl_parser
sp = stl_parser.StlParser()
from .import util
ut = util.Util()... | true | true |
f71f7031c4f8fd46d4b8fe54a23ba04cced48350 | 644 | py | Python | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | coronavirus/json_update.py | StevenHuang2020/WebSpider | 40ab36416e061da3eb98a3174f18f50260b2e2d3 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# Date: 27/Apr/2020
# Author: Steven Huang, Auckland, NZ
# License: MIT License
"""
Description: Update json file
"""
import json
import datetime
def write_file(file, content):
with open(file, 'w', newline='\n', encoding='utf-8') as f:
f.write(content)
def get_datetime():
... | 23 | 89 | 0.641304 |
import json
import datetime
def write_file(file, content):
with open(file, 'w', newline='\n', encoding='utf-8') as f:
f.write(content)
def get_datetime():
daytime = datetime.datetime.now()
return str(daytime.strftime("%Y-%m-%d %H:%M:%S"))
def update_json(file=r'update.json'):
info = {... | true | true |
f71f706d2b3fdf3882c5261d9237067d22214993 | 694 | py | Python | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | src/decisionengine_modules/glideinwms/tests/test_UniversalFrontendParams.py | BrunoCoimbra/decisionengine_modules | bfd14644eb2e16b72b75fdcc3ebe8ad1323b904f | [
"Apache-2.0"
] | null | null | null | from decisionengine_modules.glideinwms.tests.fixtures import ( # noqa: F401
gwms_module_config,
gwms_module_invalid_config,
gwms_src_dir,
)
from decisionengine_modules.glideinwms.UniversalFrontendParams import UniversalFrontendParams
def test_instantiation(gwms_src_dir, gwms_module_config): # noqa: F811... | 36.526316 | 93 | 0.792507 | from decisionengine_modules.glideinwms.tests.fixtures import (
gwms_module_config,
gwms_module_invalid_config,
gwms_src_dir,
)
from decisionengine_modules.glideinwms.UniversalFrontendParams import UniversalFrontendParams
def test_instantiation(gwms_src_dir, gwms_module_config):
params = UniversalF... | true | true |
f71f73422050b5b292bd93215895e5ecf77f8aa9 | 4,482 | py | Python | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | app/run.py | imisi-akande/disaster-response-pipeline | d691e643c57e45b226ca3cb2c0b4a708c7edfe8b | [
"MIT"
] | null | null | null | import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import rend... | 28.367089 | 77 | 0.56805 | import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import rend... | true | true |
f71f7408f54375e5147ae5b03a495305fdff73de | 1,853 | py | Python | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | null | null | null | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | 4 | 2017-11-01T16:25:49.000Z | 2018-08-22T13:50:23.000Z | mercury_agent/procedures/inspector.py | jr0d/mercury-agent | 12b75ecc951d3ab5cd15c5213df2412b108cf47c | [
"Apache-2.0"
] | 5 | 2017-10-19T12:40:15.000Z | 2018-08-21T20:18:54.000Z | # Copyright 2015 Jared Rodriguez (jared.rodriguez@rackspace.com)
# 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/LICENS... | 36.333333 | 98 | 0.729628 |
from mercury_agent.capabilities import capability
from mercury_agent.configuration import get_configuration
from mercury_agent.inspector import inspect
from mercury_agent.inspector.inspect import global_device_info
from mercury_agent.inspector.inspectors import health
@capability('inspector', descripti... | true | true |
f71f755bceeeb2c38e3122cc3e6f50cb403624cb | 453 | py | Python | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | examples/user/user_playlists.py | LorenzoCavatorta/spotify.py | 7f375f030fbac4ef3dbbd577a898b4d72f37b72b | [
"MIT"
] | null | null | null | import asyncio
import spotify
client = spotify.Client('someid', 'somesecret')
async def main():
# You can use a user with a http presence
user = await client.user_from_token('sometoken')
# Or you can get a generic user
user = await client.get_user(user_id)
# returns a list of spotify.Playlist ob... | 25.166667 | 55 | 0.715232 | import asyncio
import spotify
client = spotify.Client('someid', 'somesecret')
async def main():
user = await client.user_from_token('sometoken')
user = await client.get_user(user_id)
playlists = await user.get_playlists()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_... | true | true |
f71f7596ed6264518815e5191c7f2d43b4922fcc | 2,012 | py | Python | pylearn2/scripts/datasets/make_cifar10_whitened.py | Menerve/pylearn2 | ad7bcfda3294404aebd71f5a5c4a8623d401a98e | [
"BSD-3-Clause"
] | 3 | 2016-01-23T10:18:39.000Z | 2019-02-28T06:22:45.000Z | pylearn2/scripts/datasets/make_cifar10_whitened.py | Menerve/pylearn2 | ad7bcfda3294404aebd71f5a5c4a8623d401a98e | [
"BSD-3-Clause"
] | null | null | null | pylearn2/scripts/datasets/make_cifar10_whitened.py | Menerve/pylearn2 | ad7bcfda3294404aebd71f5a5c4a8623d401a98e | [
"BSD-3-Clause"
] | null | null | null | """
This script makes a dataset of 32x32 approximately whitened CIFAR-10 images.
"""
from pylearn2.utils import serial
from pylearn2.datasets import preprocessing
from pylearn2.utils import string_utils
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
data_dir = string_utils.preprocess('${PYLEARN2_DA... | 30.953846 | 82 | 0.789264 | """
This script makes a dataset of 32x32 approximately whitened CIFAR-10 images.
"""
from pylearn2.utils import serial
from pylearn2.datasets import preprocessing
from pylearn2.utils import string_utils
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
data_dir = string_utils.preprocess('${PYLEARN2_DA... | false | true |
f71f75b68bb7f3fa7cd5a31932f2aebd38d239e8 | 8,668 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/aio/operations/_load_balancer_outbound_rules_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.424581 | 206 | 0.671666 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f71f76fbbb3977874071bfc11924aee5822e4bea | 2,317 | py | Python | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null | itng/common/templatetags/ng_utils.py | NoviSystems/ng-utils | 29d20ba65fe2078694d18e6a33f7a448b26fa297 | [
"BSD-3-Clause"
] | null | null | null |
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from ordered_set import OrderedSet
register = template.Library()
@register.filter
def required(field):
"""
Return 'required' as a string if the BoundField's underlying ... | 31.739726 | 156 | 0.686664 |
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from ordered_set import OrderedSet
register = template.Library()
@register.filter
def required(field):
return "required" if field.field.required else ""
@register.filter
... | true | true |
f71f78bb67acd2a761bf282de28af8274e07ab9d | 1,636 | py | Python | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | Largest_Range.py | Le-bruit-de-nos-pas/python-functions | 0d86f924087da228ef46f6b984239b4ec8b7b305 | [
"MIT"
] | null | null | null | array_to_analyze = [11,7,3,4,2,5,1,0]
def largestRange(array_to_analyze):
# create a dictionary / hash table to keep track if we've seen the number already
elements = {x:0 for x in array_to_analyze} # set them all to "0"
#how many places have we moved to the left and right
left = 0
right = 0... | 38.046512 | 106 | 0.620416 | array_to_analyze = [11,7,3,4,2,5,1,0]
def largestRange(array_to_analyze):
elements = {x:0 for x in array_to_analyze} # set them all to "0"
#how many places have we moved to the left and right
left = 0
right = 0
#for each number
for entry in array_to_analyze:
#if the number ... | true | true |
f71f7a46733f735693deb2dee446ef1ebe2704f2 | 2,218 | py | Python | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | 1 | 2021-03-24T02:52:34.000Z | 2021-03-24T02:52:34.000Z | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | null | null | null | notifier.py | gkumar7/vaccine-notifier | 3177fcf7fa0eef38779e544db95844ac5b6edbdd | [
"MIT"
] | null | null | null | import time
from datetime import datetime
from math import radians, cos, sin, asin, sqrt
import requests
url = "https://www.vaccinespotter.org/api/v0/states/IL.json"
minutes = 1
center = {'lat': 0.0, 'lon': 0.0}
max_distance = 50
found = []
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circ... | 27.04878 | 100 | 0.576646 | import time
from datetime import datetime
from math import radians, cos, sin, asin, sqrt
import requests
url = "https://www.vaccinespotter.org/api/v0/states/IL.json"
minutes = 1
center = {'lat': 0.0, 'lon': 0.0}
max_distance = 50
found = []
def haversine(lon1, lat1, lon2, lat2):
lon1, lat1, lon2, lat2 = ma... | true | true |
f71f7aaa0bb10df8c141305e95139c15bca2394f | 4,249 | py | Python | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | null | null | null | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 23 | 2018-12-04T11:50:37.000Z | 2022-03-17T11:30:39.000Z | tests/test_histogram2d.py | ess-dmsc/JustBinIt | dc8242ed44f03e92f60618c96596025ec8cbc40e | [
"BSD-2-Clause"
] | 2 | 2019-07-24T11:13:41.000Z | 2020-08-04T18:33:22.000Z | import numpy as np
import pytest
from just_bin_it.histograms.histogram2d import Histogram2d
IRRELEVANT_TOPIC = "some-topic"
class TestHistogram2dFunctionality:
@pytest.fixture(autouse=True)
def prepare(self):
self.pulse_time = 1234
self.num_bins = (5, 10)
self.tof_range = (0, 10)
... | 36.62931 | 88 | 0.65992 | import numpy as np
import pytest
from just_bin_it.histograms.histogram2d import Histogram2d
IRRELEVANT_TOPIC = "some-topic"
class TestHistogram2dFunctionality:
@pytest.fixture(autouse=True)
def prepare(self):
self.pulse_time = 1234
self.num_bins = (5, 10)
self.tof_range = (0, 10)
... | true | true |
f71f7e5bf94980d2547f9d71b092b8666b476e67 | 17,709 | py | Python | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 486 | 2016-05-28T18:51:54.000Z | 2022-03-20T17:30:31.000Z | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 42 | 2018-05-25T15:57:08.000Z | 2021-01-17T18:39:59.000Z | contrib/tools/python3/src/Lib/wave.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 46 | 2016-05-28T18:52:03.000Z | 2021-06-01T07:57:51.000Z | """Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... | 34.998024 | 130 | 0.61257 |
import builtins
__all__ = ["open", "openfp", "Error", "Wave_read", "Wave_write"]
class Error(Exception):
pass
WAVE_FORMAT_PCM = 0x0001
_array_fmts = None, 'b', 'h', None, 'i'
import audioop
import struct
import sys
from chunk import Chunk
from collections import namedtuple
_wave_params = namedtuple('_wave_pa... | true | true |
f71f7e70877767a16cf3a649cd197af3470937c5 | 2,541 | py | Python | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | interface/Movie.py | BrickText/JHROM | d99b907e0837d8dcc57ab474e9435891736f0dda | [
"MIT"
] | null | null | null | from database.queries.insert_queries import INSERT_MOVIE
from database.queries.update_queries import UPDATE_MOVIE
from database.queries.delete_queries import DELETE_MOVIE
from database.queries.select_queries import SELECT_MOVIES_ORDERED_BY_RATING,\
SELECT_PROJECTION_FOR_MOVIE... | 32.164557 | 77 | 0.63046 | from database.queries.insert_queries import INSERT_MOVIE
from database.queries.update_queries import UPDATE_MOVIE
from database.queries.delete_queries import DELETE_MOVIE
from database.queries.select_queries import SELECT_MOVIES_ORDERED_BY_RATING,\
SELECT_PROJECTION_FOR_MOVIE... | true | true |
f71f7f0a14770a0fbed65f68d8dd2ab2c222a92a | 5,067 | py | Python | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 10 | 2015-09-30T02:46:48.000Z | 2021-07-23T05:03:38.000Z | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 9 | 2019-07-04T11:10:31.000Z | 2021-09-23T21:11:42.000Z | cardinal_pythonlib/cmdline.py | RudolfCardinal/pythonlib | 4c583ad1aae3c1166a4e6f964df87eb6c02a73cb | [
"Apache-2.0"
] | 4 | 2017-07-17T15:17:44.000Z | 2021-07-23T05:03:41.000Z | #!/usr/bin/env python
# cardinal_pythonlib/cmdline.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (the... | 32.273885 | 129 | 0.532465 |
import re
import subprocess
import sys
from typing import List, Union
def cmdline_split(s: str, platform: Union[int, str] = 'this') -> List[str]:
if platform == 'this':
platform = (sys.platform != 'win32')
if platform == 1:
re_cmd_lex = r'''"((?:\\["\\]|[^"])*)"|'([^']*)'|(\\.)|(&&?|... | true | true |
f71f809f8758a5472aea90c604d0f3c9e8cb4804 | 25,645 | py | Python | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | autolabeling.py | MGH-LMIC/CXR-autolabeling | 74eac30bb6eaa6c1d5a8b343743024ef6bd9db7d | [
"Apache-2.0"
] | null | null | null | import re
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_color_map
from tqdm import tqdm
from pathlib import Path
from prettytable import PrettyTable
from scipy.ndimage import gaussian_filter
from sklearn.metrics import roc_curve, precision_recall_curve... | 40.259027 | 230 | 0.569429 | import re
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_color_map
from tqdm import tqdm
from pathlib import Path
from prettytable import PrettyTable
from scipy.ndimage import gaussian_filter
from sklearn.metrics import roc_curve, precision_recall_curve... | true | true |
f71f8112d97cf0d0c960835f729f2a0a204f5395 | 6,801 | py | Python | src/python/tests/core/bot/tasks/task_creation_test.py | stplaydog/clusterfuzz | faa957d265641c031631c36f701c1dc76704a5c7 | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/bot/tasks/task_creation_test.py | stplaydog/clusterfuzz | faa957d265641c031631c36f701c1dc76704a5c7 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:59:19.000Z | 2021-05-20T22:08:07.000Z | src/python/tests/core/bot/tasks/task_creation_test.py | hixio-mh/clusterfuzz | 3f9a69ed71a4420b1a1df8864dd7f3fc1d5b6e07 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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, ... | 36.762162 | 74 | 0.704161 |
import mock
import unittest
from bot.tasks import task_creation
from datastore import data_types
from tests.test_libs import helpers
from tests.test_libs import mock_config
from tests.test_libs import test_utils
@test_utils.with_cloud_emulators('datastore')
class RequestBisectionTest(unittest.TestCase):... | true | true |
f71f83d71e89545d5f222b0941888734de4afcee | 1,798 | py | Python | benchmark/memory_profile_tool.py | coolteemf/coolteemf-deformetrica | f965d6ecc0d04f243e487468a9dafe9fe864eed2 | [
"MIT"
] | 2 | 2022-03-04T11:19:30.000Z | 2022-03-08T04:47:22.000Z | benchmark/memory_profile_tool.py | lepennec/Deformetrica_multiscale | dbcb69962dd02f14dde5d63a9abc1de69112f273 | [
"MIT"
] | null | null | null | benchmark/memory_profile_tool.py | lepennec/Deformetrica_multiscale | dbcb69962dd02f14dde5d63a9abc1de69112f273 | [
"MIT"
] | 1 | 2022-03-07T09:52:52.000Z | 2022-03-07T09:52:52.000Z | import resource
import sys
import time
from threading import Thread
from memory_profiler import memory_usage
import GPUtil
import torch
# _cudart = ctypes.CDLL('libcudart.so')
#
#
# def start_cuda_profile():
# # As shown at http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__PROFILER.html,
# # the re... | 23.350649 | 94 | 0.660178 | import resource
import sys
import time
from threading import Thread
from memory_profiler import memory_usage
import GPUtil
import torch
': []}
def run(self):
while self.run_flag:
self.data['ram'].append(self.current_ram_usage())
time.sleep(self.freq)
def stop(se... | true | true |
f71f84709e6e370286285ed6bcfe99e6b5009b1b | 436 | py | Python | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | 2 | 2019-03-19T21:44:11.000Z | 2019-04-16T21:41:50.000Z | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | null | null | null | lessrpc_stub/StubConstants.py | MoujiRPC/mouji_stub_py2x | 3f8d7c0ccdfade7f80020528ca9ddb52556def6c | [
"MIT"
] | null | null | null | '''
Created on Nov 7, 2017
@author: Salim
'''
CONF_PARAM_NAME_SERVER_URL = "CONF.NAMESERVER.URL"
CONF_PARAM_NAME_SERVER_PORT = "CONF.NAMESERVER.PORT"
RPC_PROTOCOL = "http://"
LESS_RPC_REQUEST_PING = "/ping"
LESS_RPC_REQUEST_EXECUTE = "/execute"
LESS_RPC_REQUEST_SERVICE = "/service"
LESS_RPC_REQUEST_INFO = "/info"
... | 17.44 | 52 | 0.743119 |
CONF_PARAM_NAME_SERVER_URL = "CONF.NAMESERVER.URL"
CONF_PARAM_NAME_SERVER_PORT = "CONF.NAMESERVER.PORT"
RPC_PROTOCOL = "http://"
LESS_RPC_REQUEST_PING = "/ping"
LESS_RPC_REQUEST_EXECUTE = "/execute"
LESS_RPC_REQUEST_SERVICE = "/service"
LESS_RPC_REQUEST_INFO = "/info"
HTTP_PROTOCOL = "http://"
HTTPS_PROTOCOL = "htt... | true | true |
f71f85094dbcb9fd0be92bb6eec98b8e5363d046 | 100,399 | py | Python | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | src/sardana/macroserver/macros/scan.py | aureocarneiro/sardana | 43644c9966d73c7a9023b53e97b530f3ea0dfb39 | [
"CC-BY-3.0"
] | null | null | null | ##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | 43.126718 | 99 | 0.587436 | id value for mode %s' % mode)
self._data = self._gScan.data
def _stepGenerator(self):
step = {}
step["integ_time"] = self.integ_time
step["pre-move-hooks"] = self.getHooks('pre-move')
step["post-move-hooks"] = self.getHooks('p... | true | true |
f71f852be23973714c7a9eb2960199f224ce82d6 | 15,227 | py | Python | train_wide_resnet.py | 1vn/L0_regularization | 3c44e0e3adc80c7167a5bd1439aa1187747392bb | [
"MIT"
] | null | null | null | train_wide_resnet.py | 1vn/L0_regularization | 3c44e0e3adc80c7167a5bd1439aa1187747392bb | [
"MIT"
] | null | null | null | train_wide_resnet.py | 1vn/L0_regularization | 3c44e0e3adc80c7167a5bd1439aa1187747392bb | [
"MIT"
] | null | null | null | import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
from models import L0WideResNet, TDWideResNet
from dataloaders import cifar10, cifar100
from utils import save_checkpoint, AverageMeter, accuracy
from torch.opti... | 35.744131 | 99 | 0.605044 | import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
from models import L0WideResNet, TDWideResNet
from dataloaders import cifar10, cifar100
from utils import save_checkpoint, AverageMeter, accuracy
from torch.opti... | false | true |
f71f8633b734353bac2000dd7387efb6ae942340 | 2,457 | py | Python | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/polyaxon/utils/cache.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 33.202703 | 84 | 0.728938 |
from polyaxon.exceptions import PolyaxonSchemaError
from polyaxon.managers.project import ProjectConfigManager
from polyaxon.utils.formatting import Printer
CACHE_ERROR = (
"Found an invalid project config or project config cache, "
"if you are using Polyaxon CLI please run: "
"`polyaxon con... | true | true |
f71f864e03a6b1e01179e730c110c5a2c2ec95e7 | 1,308 | py | Python | Mac/Modules/ibcarbon/IBCarbonscan.py | cemeyer/tauthon | 2c3328c5272cffa2a544542217181c5828afa7ed | [
"PSF-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | python/src/Mac/Modules/ibcarbon/IBCarbonscan.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | python/src/Mac/Modules/ibcarbon/IBCarbonscan.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | # IBCarbonscan.py
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
def main():
print "---Scanning IBCarbonRuntime.h---"
input = ["IBCarbonRuntime.h"]
output = "IBCarbongen.py"
defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
scanne... | 27.25 | 93 | 0.612385 |
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
def main():
print "---Scanning IBCarbonRuntime.h---"
input = ["IBCarbonRuntime.h"]
output = "IBCarbongen.py"
defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
scanner = IBCarbon_Scan... | false | true |
f71f8692d84797110282e3423509cce733cecedd | 13,447 | py | Python | containers.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T08:48:52.000Z | 2016-06-17T08:48:52.000Z | containers.py | Fy-/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T18:06:41.000Z | 2016-06-17T18:06:41.000Z | containers.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 2 | 2018-02-11T02:14:11.000Z | 2020-01-07T05:40:34.000Z | # -*- coding: utf-8 -*-
"""
fysql.containers
~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from functools import wraps
import copy
import hashlib
from .entities import SQLEntity, SQLJoin, SQLCondition, SQLColumn
fro... | 25.809981 | 121 | 0.692348 |
from __future__ import unicode_literals
from functools import wraps
import copy
import hashlib
from .entities import SQLEntity, SQLJoin, SQLCondition, SQLColumn
from .columns import FKeyColumn, PKeyColumn, IntegerColumn
from .static import Tables
class ContainerWalker(object):
def __init__(self, entities, separa... | true | true |
f71f86944f4a3f67142dcc0a2330fcdd6e0e21be | 8,966 | py | Python | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_resource_attributes.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 30.39322 | 361 | 0.565135 |
from pprint import pformat
from six import iteritems
import re
class V1ResourceAttributes(object):
swagger_types = {
'group': 'str',
'name': 'str',
'namespace': 'str',
'resource': 'str',
'subresource': 'str',
'verb': 'str',
'version':... | true | true |
f71f86e48de8074e6e823ee832ad036d915afdae | 16,478 | py | Python | figures/kCSD_properties/targeted_basis.py | rdarie/kCSD-python | 5b9e1b1dce2ff95c0d981c2c4015b7a75199de9a | [
"BSD-3-Clause"
] | 11 | 2017-11-06T21:24:18.000Z | 2022-02-07T21:17:13.000Z | figures/kCSD_properties/targeted_basis.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 105 | 2017-12-13T12:49:54.000Z | 2022-03-19T12:25:51.000Z | figures/kCSD_properties/targeted_basis.py | aeladly91/kCSD-python | 4dd0015e9c5598e7eceeeb25668e696e495b2026 | [
"BSD-3-Clause"
] | 27 | 2017-06-08T07:32:32.000Z | 2022-02-07T21:17:15.000Z | """
@author: mkowalska
"""
import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY ... | 31.749518 | 82 | 0.585933 | import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY = DAY.strftime('%Y%m%d')
TI... | true | true |
f71f873815e728bc7fb92f7c3c25537c688114fb | 58,117 | py | Python | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 75 | 2021-02-25T20:04:53.000Z | 2022-03-12T12:12:58.000Z | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 1 | 2021-08-08T13:12:27.000Z | 2021-08-08T13:12:27.000Z | src/train_eval.py | chanyh0/PyTorch-StudioGAN | 5a912affc1ec975d97a33a12d1c96d05d4b883f0 | [
"MIT"
] | 7 | 2021-03-02T18:47:45.000Z | 2022-01-26T13:49:25.000Z | # PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# train_eval.py
import numpy as np
import sys
import glob
from scipy import ndimage
from os.path import join
from PIL import Image... | 61.958422 | 176 | 0.573189 |
import numpy as np
import sys
import glob
from scipy import ndimage
from os.path import join
from PIL import Image
from tqdm import tqdm
from datetime import datetime
from metrics.IS import calculate_incep_score
from metrics.FID import calculate_fid_score
from metrics.F_beta import calculate_f_beta_score
from m... | true | true |
f71f885cac4c2f109c64f495a43df8973c10dbfa | 2,038 | py | Python | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | 1 | 2021-09-14T15:55:56.000Z | 2021-09-14T15:55:56.000Z | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | null | null | null | benchmark/points/edge_cnn_ke.py | KuangenZhang/pytorch_geometric | 0bfc79a5eaccfcd16a82395e8578a90c5e44759f | [
"MIT"
] | null | null | null | import argparse
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, LeakyReLU
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
from datasets import get_dataset
from train_eval import run
parser = argparse.ArgumentParser()
parser.add_argument('--epoc... | 33.966667 | 78 | 0.663395 | import argparse
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, LeakyReLU
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
from datasets import get_dataset
from train_eval import run
parser = argparse.ArgumentParser()
parser.add_argument('--epoc... | true | true |
f71f895df82d2833eb823b4a18567f17d274743e | 1,316 | py | Python | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | torch2trt/converters/grid_sample.py | huliang2016/torch2trt_dynamic | aa55f354a742d26272eae93934d0cff7cd946cbf | [
"MIT"
] | null | null | null | from torch2trt.torch2trt import *
from torch2trt.plugins import *
@tensorrt_converter('torch.nn.functional.grid_sample')
def convert_grid_sample(ctx):
input = ctx.method_args[0]
grid = get_arg(ctx, 'grid', pos=1, default=None)
mode = get_arg(ctx, 'mode', pos=2, default='bilinear')
padding_mod... | 34.631579 | 74 | 0.591945 | from torch2trt.torch2trt import *
from torch2trt.plugins import *
@tensorrt_converter('torch.nn.functional.grid_sample')
def convert_grid_sample(ctx):
input = ctx.method_args[0]
grid = get_arg(ctx, 'grid', pos=1, default=None)
mode = get_arg(ctx, 'mode', pos=2, default='bilinear')
padding_mod... | true | true |
f71f89ceb3c12643c41afd03550daee9d2e132a8 | 658 | py | Python | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 46 | 2021-06-10T02:27:32.000Z | 2022-03-27T11:33:24.000Z | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 58 | 2021-07-03T13:58:20.000Z | 2022-03-13T16:45:35.000Z | main/lynx/template.py | RoastVeg/cports | 803c7f07af341eb32f791b6ec1f237edb2764bd5 | [
"BSD-2-Clause"
] | 6 | 2021-07-04T10:46:40.000Z | 2022-01-09T00:03:59.000Z | pkgname = "lynx"
pkgver = "2.9.0_pre10"
_uver = "2.9.0dev.10"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-widec", "--enable-ipv6", "--with-zlib", "--with-bzlib",
"--with-ssl"
]
hostmakedepends = ["pkgconf"]
makedepends = [
"zlib-devel", "libbz2-devel", "ncurses-devel", "openssl-dev... | 31.333333 | 92 | 0.696049 | pkgname = "lynx"
pkgver = "2.9.0_pre10"
_uver = "2.9.0dev.10"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-widec", "--enable-ipv6", "--with-zlib", "--with-bzlib",
"--with-ssl"
]
hostmakedepends = ["pkgconf"]
makedepends = [
"zlib-devel", "libbz2-devel", "ncurses-devel", "openssl-dev... | true | true |
f71f8a26e59f7652219836c7aac3c3072c01af66 | 5,150 | py | Python | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | conf.py | SmartDataProjects/dynamo-docs | dffc4e853ffd8bc1a1eabce8b34c1084412cb562 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Dynamo documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 5 10:40:30 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 32.389937 | 121 | 0.687379 |
extensions = ['sphinx.ext.intersphinx']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Dynamo'
copyright = u'2018, Yutaro Iiyama, Max Goncharov, Benedikt Maier, Daniel Abercrombie, Siddarth Narayanan, Christoph Paus'
author = u'Yutaro I... | true | true |
f71f8a38750a1ac3b7381ca20272a675585b6e22 | 414 | py | Python | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | scanEngine/migrations/0006_auto_20200718_0429.py | Suprita-25/rengine | d6aabb49f27f7ad6039477c16a96213b0d80f81f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-18 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanEngine', '0005_auto_20200718_0407'),
]
operations = [
migrations.AlterField(
model_name='wordlist',
name='path',... | 21.789474 | 75 | 0.60628 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanEngine', '0005_auto_20200718_0407'),
]
operations = [
migrations.AlterField(
model_name='wordlist',
name='path',
field=models.CharField(blank=True,... | true | true |
f71f8aad34c9f5bcb36563c0f477edba60015bc9 | 1,029 | py | Python | printing.py | shuckc/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 3 | 2017-02-03T18:29:35.000Z | 2020-02-19T14:46:05.000Z | printing.py | TeaEngineering/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 3 | 2015-08-03T12:01:25.000Z | 2015-12-26T13:52:18.000Z | printing.py | TeaEngineering/printerface | 1f3eeca4c4d090c119404fd354eac02a4f68a56b | [
"BSD-3-Clause"
] | 1 | 2016-03-21T13:45:34.000Z | 2016-03-21T13:45:34.000Z | #!/usr/bin/python
import sys
import subprocess
printers = []
def getPrinters():
global printers
if not sys.platform == "linux2":
return ['default']
if len(printers) > 0: return printers
try:
process = subprocess.Popen(["lpstat", "-a"], stdout=subprocess.PIPE)
result = process.communicate()[0].strip()
# KO... | 30.264706 | 96 | 0.678328 |
import sys
import subprocess
printers = []
def getPrinters():
global printers
if not sys.platform == "linux2":
return ['default']
if len(printers) > 0: return printers
try:
process = subprocess.Popen(["lpstat", "-a"], stdout=subprocess.PIPE)
result = process.communicate()[0].strip()
print(result)
pr... | true | true |
f71f8acdefea0e50130dc14864f4cd1d3a47060b | 4,453 | py | Python | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | null | null | null | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | 1 | 2019-12-03T20:13:23.000Z | 2019-12-03T20:13:23.000Z | rpc/client.py | watermelonano/melonbot | 7ac8418020e63e340f1f6df13ad4e85d6c864cda | [
"MIT"
] | null | null | null | import aiohttp
import rapidjson as json
import socket
from config import Config
from typing import List, Tuple
class RPCClient(object):
_instance = None
def __init__(self):
raise RuntimeError('Call instance() instead')
@classmethod
def instance(cls) -> 'RPCClient':
if cls._instance is... | 35.062992 | 137 | 0.587469 | import aiohttp
import rapidjson as json
import socket
from config import Config
from typing import List, Tuple
class RPCClient(object):
_instance = None
def __init__(self):
raise RuntimeError('Call instance() instead')
@classmethod
def instance(cls) -> 'RPCClient':
if cls._instance is... | true | true |
f71f8b0bf067a0ad1bfabdb4bd73bb6ce0671e67 | 2,071 | py | Python | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/tests/unit/packet/test_openflow.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# 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 ... | 31.861538 | 80 | 0.627233 |
from __future__ import print_function
import logging
import os
import sys
import unittest
from nose.tools import eq_
from nose.tools import ok_
from ryu.lib import pcaplib
from ryu.lib.packet import openflow
from ryu.lib.packet import packet
from ryu.utils import binary_str
LOG = lo... | true | true |
f71f8bd977b164017df62a900a494bb42ac54683 | 2,444 | py | Python | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | tests/test_data_structures/test_linked_list.py | titus-ong/my-python-algorithms | d9eecf2846c0a7dd8978f11fec8e8f52be23f3bc | [
"MIT"
] | null | null | null | import pytest
from my_python_algorithms.data_structures.linked_list import LinkedList, Node
def test_node():
n = Node(1)
assert 1 == n.value
assert None is n.next
def test_empty_ll():
ll = LinkedList()
assert None is ll.head
def test_ll_with_head():
ll = LinkedList(1)
assert 1 == ll.he... | 17.090909 | 77 | 0.614157 | import pytest
from my_python_algorithms.data_structures.linked_list import LinkedList, Node
def test_node():
n = Node(1)
assert 1 == n.value
assert None is n.next
def test_empty_ll():
ll = LinkedList()
assert None is ll.head
def test_ll_with_head():
ll = LinkedList(1)
assert 1 == ll.he... | true | true |
f71f8c4271a58e5975430cb596344aa1a4927d19 | 3,169 | py | Python | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/device_tracker/bluetooth_tracker.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """Tracking for bluetooth devices."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_IN... | 34.824176 | 76 | 0.618492 | import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL,
load_config, PLATFORM_SCHE... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.