hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70e988f4dafef4a16d2ad7c3426c886babdf411 | 2,642 | py | Python | internal/twirptest/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | internal/twirptest/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | internal/twirptest/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Code generated by protoc-gen-twirp_python v7.1.0, DO NOT EDIT.
# source: service.proto
try:
import httplib
from urllib2 import Request, HTTPError, urlopen
except ImportError:
import http.client as httplib
from urllib.request import Request, urlopen
from urllib.error import HTTPError
import json
f... | 31.082353 | 88 | 0.613929 |
try:
import httplib
from urllib2 import Request, HTTPError, urlopen
except ImportError:
import http.client as httplib
from urllib.request import Request, urlopen
from urllib.error import HTTPError
import json
from google.protobuf import symbol_database as _symbol_database
import sys
_sym_db = _s... | true | true |
f70e98a26c7f36c76b2da78699df18fa1459660b | 8,717 | py | Python | dropbox/packing-your-dropbox/packurbox.py | ramsay/ramsay-snippets | d64e30a7d7b64eedab46150babb2bb675b3da8ff | [
"MIT"
] | null | null | null | dropbox/packing-your-dropbox/packurbox.py | ramsay/ramsay-snippets | d64e30a7d7b64eedab46150babb2bb675b3da8ff | [
"MIT"
] | null | null | null | dropbox/packing-your-dropbox/packurbox.py | ramsay/ramsay-snippets | d64e30a7d7b64eedab46150babb2bb675b3da8ff | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Robert Ramsay <robert.alan.ramsay@gmail.com>
Packing your Dropbox
When you're working with petabytes of data, you have to store files wherever they can fit. All of us here at Dropbox are always searching for more ways to efficiently pack data into smaller and more manageable chunks. The fun begins... | 31.356115 | 574 | 0.533326 |
import sys
class DropBox:
w = 0
h = 0
x = 0
y = 0
def __init__(self,vector=None, w=0, h=0):
if vector:
self.w, self.h = vector
else:
self.w = w
self.h = h
def rotate(self):
t = self.w
self.w = self.h
self.h = t
... | true | true |
f70e997410788ed72a9b2883d54249e487064f32 | 2,675 | py | Python | libralli/circcuitpython/adafruit-circuitpython-bundle-7.x-mpy-20211225/examples/progressbar_magtag_simpletest.py | Yarik9008/SoftAcademic | 118c9dc4620ca444c1557edd141a838820577202 | [
"MIT"
] | 5 | 2020-04-14T20:50:30.000Z | 2021-10-19T18:49:46.000Z | libralli/circcuitpython/adafruit-circuitpython-bundle-7.x-mpy-20211225/examples/progressbar_magtag_simpletest.py | Yarik9008/SoftAcademic | 118c9dc4620ca444c1557edd141a838820577202 | [
"MIT"
] | 25 | 2020-07-17T03:05:56.000Z | 2022-01-06T16:00:51.000Z | libralli/circcuitpython/adafruit-circuitpython-bundle-7.x-mpy-20211225/examples/progressbar_magtag_simpletest.py | Yarik9008/SoftAcademic | 118c9dc4620ca444c1557edd141a838820577202 | [
"MIT"
] | 10 | 2020-01-07T20:14:56.000Z | 2021-11-14T20:34:43.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
Basic progressbar example script
adapted for use on MagTag.
"""
import time
import board
import displayio
import digitalio
from adafruit_progressbar.progressbar import HorizontalProgressBar
# use built in display (PyPort... | 27.864583 | 98 | 0.741682 |
import time
import board
import displayio
import digitalio
from adafruit_progressbar.progressbar import HorizontalProgressBar
display = board.DISPLAY
time.sleep(display.time_to_refresh)
up_btn = digitalio.DigitalInOut(board.BUTTON_B)
up_btn.direction = digitalio.Direction.INPUT
up_btn.pull = digitalio.Pull.UP
... | true | true |
f70e99a6d83ec20f3d35576e5d254633a5aa413c | 19,416 | py | Python | ServidorPython/python32_web/Lib/site-packages/nbconvert/nbconvertapp.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 4 | 2019-07-26T11:32:22.000Z | 2019-09-11T05:34:59.000Z | ServidorPython/python32_web/Lib/site-packages/nbconvert/nbconvertapp.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 1 | 2021-09-02T17:44:02.000Z | 2021-09-02T17:44:02.000Z | ServidorPython/python32_web/Lib/site-packages/nbconvert/nbconvertapp.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 2 | 2019-08-28T14:57:54.000Z | 2019-11-26T16:18:30.000Z | #!/usr/bin/env python
"""NbConvert is a utility for conversion of .ipynb files.
Command-line interface for the NbConvert conversion utility.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import logging
import sys
import... | 37.410405 | 113 | 0.613103 |
from __future__ import print_function
import logging
import sys
import os
import glob
from jupyter_core.application import JupyterApp, base_aliases, base_flags
from traitlets.config import catch_config_error, Configurable
from traitlets import (
Unicode, List, Instance, DottedObjectName, Type, Bool,
defa... | true | true |
f70e9ab4127f82a7bc61abb5b1f4d8af7ef4fcd5 | 122 | py | Python | contributed_traders/util.py | andrewsonin/abides_dev | e8a9c8450bbbe98597f31767362c86eb193597a0 | [
"BSD-3-Clause"
] | null | null | null | contributed_traders/util.py | andrewsonin/abides_dev | e8a9c8450bbbe98597f31767362c86eb193597a0 | [
"BSD-3-Clause"
] | null | null | null | contributed_traders/util.py | andrewsonin/abides_dev | e8a9c8450bbbe98597f31767362c86eb193597a0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from pathlib import Path
def get_file(fname):
return Path(__file__).resolve().parent / fname
| 17.428571 | 50 | 0.729508 |
from pathlib import Path
def get_file(fname):
return Path(__file__).resolve().parent / fname
| true | true |
f70e9b3086a20a853e14284409d0e7e61f4feaf3 | 326 | py | Python | utils/bytes_utils.py | linyuan0213/qb-bot | be8a172d7d72a7e3878f89ba341c3b5f36e3d76c | [
"MIT"
] | 3 | 2021-08-28T18:14:54.000Z | 2022-01-19T18:22:59.000Z | utils/bytes_utils.py | linyuan0213/qb-bot | be8a172d7d72a7e3878f89ba341c3b5f36e3d76c | [
"MIT"
] | null | null | null | utils/bytes_utils.py | linyuan0213/qb-bot | be8a172d7d72a7e3878f89ba341c3b5f36e3d76c | [
"MIT"
] | 1 | 2021-07-16T08:37:03.000Z | 2021-07-16T08:37:03.000Z | def bytes_to_human(n):
symbols = ('KB', 'MB', 'GB', 'TB', 'PB', 'EB')
prefix = {}
for i, s in enumerate(symbols):
prefix[s] = 1 << (i + 1) * 10
for s in reversed(symbols):
if n >= prefix[s]:
value = float(n) / prefix[s]
return '%.1f%s' % (value, s)
return '%sB... | 29.636364 | 50 | 0.46319 | def bytes_to_human(n):
symbols = ('KB', 'MB', 'GB', 'TB', 'PB', 'EB')
prefix = {}
for i, s in enumerate(symbols):
prefix[s] = 1 << (i + 1) * 10
for s in reversed(symbols):
if n >= prefix[s]:
value = float(n) / prefix[s]
return '%.1f%s' % (value, s)
return '%sB... | true | true |
f70e9b6e0d6c5f3a42f4bb7ff0f34b00d662bc27 | 1,338 | py | Python | spartan/examples/ssvd/qr.py | GabrielWen/spartan | ce3bf7f2bb551d7f996a1884acef819b620cc854 | [
"Apache-2.0"
] | 156 | 2015-01-10T21:54:25.000Z | 2021-10-17T14:13:57.000Z | spartan/examples/ssvd/qr.py | GabrielWen/spartan | ce3bf7f2bb551d7f996a1884acef819b620cc854 | [
"Apache-2.0"
] | 8 | 2015-01-05T16:34:18.000Z | 2015-12-11T08:12:28.000Z | spartan/examples/ssvd/qr.py | GabrielWen/spartan | ce3bf7f2bb551d7f996a1884acef819b620cc854 | [
"Apache-2.0"
] | 24 | 2015-01-10T21:55:48.000Z | 2021-04-14T08:09:34.000Z | import spartan
from spartan import expr, core
import numpy as np
from sys import stderr
def qr(Y):
''' Compute the thin qr factorization of a matrix.
Factor the matrix Y as QR, where Q is orthonormal and R is
upper-triangular.
Parameters
----------
Y: Spartan array of shape (M, K).
Notes
----------
... | 29.086957 | 75 | 0.675635 | import spartan
from spartan import expr, core
import numpy as np
from sys import stderr
def qr(Y):
YTY = expr.dot(expr.transpose(Y), Y).optimized().glom()
# Do cholesky decomposition and get R.
R = np.linalg.cholesky(YTY).T
# Find the inverse of R
inv_R = np.linalg.inv(R)
# Q = Y * in... | true | true |
f70e9bc29651fbb0c65ebc831bb2635b14150dfd | 3,633 | py | Python | servers/migrations/0012_auto__add_field_server_samba_base_folder.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | servers/migrations/0012_auto__add_field_server_samba_base_folder.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | servers/migrations/0012_auto__add_field_server_samba_base_folder.py | PolyLAN/azimut-gestion | 0b076570d7ceeef8cfd9c8e65fd0495aa16d3c8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Server.samba_base_folder'
db.add_column(u'servers_server', 'samba_base_folder',
... | 63.736842 | 186 | 0.57886 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'servers_server', 'samba_base_folder',
self.gf('django.db.models.fields.CharField')(default='... | true | true |
f70e9c0b8bac3d670748990df3ff0e02f0a7f8ad | 15,619 | py | Python | zerver/lib/cache.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/cache.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/cache.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
from functools import wraps
from django.core.cache import cache as djcache
from django.core.cache import caches
from django.conf import settings
from django.db.models import Q
from django.core.cache.backends.base import BaseCache
from typin... | 39.541772 | 133 | 0.681414 | from __future__ import absolute_import
from __future__ import print_function
from functools import wraps
from django.core.cache import cache as djcache
from django.core.cache import caches
from django.conf import settings
from django.db.models import Q
from django.core.cache.backends.base import BaseCache
from typin... | true | true |
f70e9c0f85a4b70d03afc9fad7137e074aea7e36 | 1,674 | py | Python | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/scalability_space_galewsky_cheyenne_intel/postprocessing.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 6 | 2017-11-20T08:12:46.000Z | 2021-03-11T15:32:36.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/scalability_space_galewsky_cheyenne_intel/postprocessing.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 4 | 2018-02-02T21:46:33.000Z | 2022-01-11T11:10:27.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/scalability_space_galewsky_cheyenne_intel/postprocessing.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 12 | 2016-03-01T18:33:34.000Z | 2022-02-08T22:20:31.000Z | #! /usr/bin/env python3
from SWEET import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
from mule.plotting.Plotting import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
#
# Load data
#
j = JobsData('job_bench_*', verbosity=0)
#
# Create g... | 18.6 | 67 | 0.737754 |
from SWEET import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
from mule.plotting.Plotting import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
j = JobsData('job_bench_*', verbosity=0)
groups = ['runtime.timestepping_method']
c = ... | true | true |
f70e9d0ca009d2d068924b1345df34f152420b7c | 1,346 | py | Python | setup.py | FaizChishtie/MrTopo | e6a674738d8b0a0c56edde2be0ae272ea9e62f1a | [
"MIT"
] | 1 | 2021-01-26T11:01:32.000Z | 2021-01-26T11:01:32.000Z | setup.py | FaizChishtie/MrTopo | e6a674738d8b0a0c56edde2be0ae272ea9e62f1a | [
"MIT"
] | null | null | null | setup.py | FaizChishtie/MrTopo | e6a674738d8b0a0c56edde2be0ae272ea9e62f1a | [
"MIT"
] | 1 | 2020-12-23T22:01:09.000Z | 2020-12-23T22:01:09.000Z | import setuptools
import re
with open("README.md", "r") as fh:
long_description = fh.read()
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('mrtopo/__main__.py').read(),
re.M
).group(1)
setuptools.setup(
name='mrtopo',
version=version,
packages=setuptools.find_packages(),
u... | 29.911111 | 66 | 0.61367 | import setuptools
import re
with open("README.md", "r") as fh:
long_description = fh.read()
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('mrtopo/__main__.py').read(),
re.M
).group(1)
setuptools.setup(
name='mrtopo',
version=version,
packages=setuptools.find_packages(),
u... | true | true |
f70e9e8f3f4e25b72d078669cef22e5f17566484 | 1,495 | py | Python | setup.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | 1 | 2017-03-19T12:06:58.000Z | 2017-03-19T12:06:58.000Z | setup.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | null | null | null | setup.py | ucamhal/jsonlogging | 7606abb00c3cdc9536c8947d5ab1e210716e8d47 | [
"BSD-2-Clause"
] | null | null | null | from setuptools import setup
def get_version(filename):
"""
Parse the value of the __version__ var from a Python source file
without running/importing the file.
"""
import re
version_pattern = r"^ *__version__ *= *['\"](\d+\.\d+\.\d+)['\"] *$"
match = re.search(version_pattern, open(filena... | 33.977273 | 75 | 0.623411 | from setuptools import setup
def get_version(filename):
import re
version_pattern = r"^ *__version__ *= *['\"](\d+\.\d+\.\d+)['\"] *$"
match = re.search(version_pattern, open(filename).read(), re.MULTILINE)
assert match, ("No version found in file: {!r} matching pattern: {!r}"
.for... | true | true |
f70e9eba1ab08ba41a6d14813985705f6afe0f1e | 94,216 | py | Python | sympy/plotting/plot.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/plotting/plot.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/plotting/plot.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | """Plotting module for SymPy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from SymPy
expressions. ``plot_backends`` is a dictionary with all th... | 35.905488 | 128 | 0.565721 |
from collections.abc import Callable
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.core.function import arity, Function
from sympy.core.symbol import (Dummy, Symbol)
from sympy.core.sympify import sympify
from sympy.external import ... | true | true |
f70e9f82018e07c830743995d2a988adcd978449 | 53,574 | py | Python | qutip/qip/circuit.py | lebinyu/qutip | 19f172cbb1689f3295dd2561057543da342fb646 | [
"BSD-3-Clause"
] | null | null | null | qutip/qip/circuit.py | lebinyu/qutip | 19f172cbb1689f3295dd2561057543da342fb646 | [
"BSD-3-Clause"
] | null | null | null | qutip/qip/circuit.py | lebinyu/qutip | 19f172cbb1689f3295dd2561057543da342fb646 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 46.707934 | 79 | 0.434987 |
,
'ISWAP': r'{i}{\rm SWAP}',
'SQRTSWAP': r'\sqrt{\rm SWAP}',
'SQRTISWAP': r'\sqrt{{i}\rm SWAP}',
'FREDKIN': r'{\rm FREDKIN}',
'TOFFOLI': r'{\rm TOFFOLI}',
'GLOBALPHASE': r'{\rm Ph}',
}
def _gate_label(name, arg_label):
if name in _gate_name_to_label:
... | true | true |
f70ea0db8a6447a49d3bf80ab3739ca2d79b0877 | 5,469 | py | Python | docs/source/conf.py | holavpv/osmnx | df1feb06f2c2be3c042f524428e3993f22560ee6 | [
"MIT"
] | 1 | 2020-07-09T22:11:52.000Z | 2020-07-09T22:11:52.000Z | docs/source/conf.py | holavpv/osmnx | df1feb06f2c2be3c042f524428e3993f22560ee6 | [
"MIT"
] | null | null | null | docs/source/conf.py | holavpv/osmnx | df1feb06f2c2be3c042f524428e3993f22560ee6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
OSMnx documentation build configuration file.
Created by sphinx-quickstart on Sun Feb 4 13:53:34 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 fi... | 29.403226 | 79 | 0.672518 |
import os
import sys
sys.path.insert(0, os.path.abspath("../.."))
autodoc_mock_imports = [
"dateutil",
"geopandas",
"matplotlib",
"matplotlib.cm",
"matplotlib.colors",
"matplotlib.pyplot",
"networkx",
"numpy",
"pandas",
"pyproj",
"requests",
"scipy",
"scipy.spa... | true | true |
f70ea0e76e8e27653ad98588d7b83e00bb2a047a | 5,613 | py | Python | tests/unit/test_config.py | nickatnight/praw | 6ba5c92e5d5210338c0a2a2755a5e5e226a002fa | [
"BSD-2-Clause"
] | 2,360 | 2015-01-03T18:27:44.000Z | 2022-03-26T23:24:49.000Z | tests/unit/test_config.py | nickatnight/praw | 6ba5c92e5d5210338c0a2a2755a5e5e226a002fa | [
"BSD-2-Clause"
] | 1,187 | 2015-01-04T18:42:10.000Z | 2022-03-28T13:46:33.000Z | tests/unit/test_config.py | nickatnight/praw | 6ba5c92e5d5210338c0a2a2755a5e5e226a002fa | [
"BSD-2-Clause"
] | 591 | 2015-01-04T17:33:34.000Z | 2022-03-27T20:28:26.000Z | import os
import sys
from unittest import mock
import pytest
from praw.config import Config
from praw.exceptions import ClientException
class TestConfig:
@staticmethod
def _assert_config_read(environment, mock_config):
mock_instance = mock_config.return_value
Config.CONFIG = None # Force co... | 37.42 | 79 | 0.618742 | import os
import sys
from unittest import mock
import pytest
from praw.config import Config
from praw.exceptions import ClientException
class TestConfig:
@staticmethod
def _assert_config_read(environment, mock_config):
mock_instance = mock_config.return_value
Config.CONFIG = None
p... | true | true |
f70ea1c658fc200cff6ab95f636b343fc4f6d6b7 | 2,057 | py | Python | Validation/Performance/scripts/cmsScimarkStop.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 13 | 2015-11-30T15:49:45.000Z | 2022-02-08T16:11:30.000Z | Validation/Performance/scripts/cmsScimarkStop.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 640 | 2015-02-11T18:55:47.000Z | 2022-03-31T14:12:23.000Z | Validation/Performance/scripts/cmsScimarkStop.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 51 | 2015-08-11T21:01:40.000Z | 2022-03-30T07:31:34.000Z | #! /usr/bin/env python
#Script to
#1-check for cmsScimarkLaunch (infinite loop) scripts
#2-kill them
#3-report their results using cmsScimarkParser.py
from __future__ import print_function
import subprocess,os,sys
def main():
#Use ps -ef to look for cmsScimarkLaunch processes
ps_stdouterr=subprocess.Popen("ps... | 45.711111 | 207 | 0.656782 |
from __future__ import print_function
import subprocess,os,sys
def main():
ps_stdouterr=subprocess.Popen("ps -efww|grep cmsScimarkLaunch|grep -v grep|grep -v 'sh -c'",shell=True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
if ps_stdouterr:
ps_lines=ps_stdouterr.readlines()
... | true | true |
f70ea28bcf4185dc675728f2549fd2e9447346be | 77,417 | py | Python | Graphing_Summaries.py | GrantRoss-Tenki/Malawi-CQC-CSC-OSU-Work | a720e0451579945ba10eafdafe2e0d59a86d5cfb | [
"MIT"
] | null | null | null | Graphing_Summaries.py | GrantRoss-Tenki/Malawi-CQC-CSC-OSU-Work | a720e0451579945ba10eafdafe2e0d59a86d5cfb | [
"MIT"
] | null | null | null | Graphing_Summaries.py | GrantRoss-Tenki/Malawi-CQC-CSC-OSU-Work | a720e0451579945ba10eafdafe2e0d59a86d5cfb | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
#from pylab import plot, show, xlim,figure,hold, ylim,legend, boxplot, setup, axes
import seaborn as sns
# Is this a personal or work computer
# Are you graphing for hood or no hood
Computer = 'personal' #or 'personal' or 'work'
Hood_o... | 50.965767 | 152 | 0.657504 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
Computer = 'personal'
Hood_or_no = 'no_hood'
Household_removal = [1045]
Household_removal_NO_Hood_fuel_day_adult = [1045]
Household_removal_Hood_fuel_day_adult = [2020]
Household_removal_NO_Hood_PM = [1... | true | true |
f70ea318486da939ee5b7f2bf6eee6d6a675026f | 7,269 | py | Python | tests/metarl/torch/algos/test_torch_algo_utils.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | 2 | 2020-03-15T14:35:15.000Z | 2021-02-15T16:38:00.000Z | tests/metarl/torch/algos/test_torch_algo_utils.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | null | null | null | tests/metarl/torch/algos/test_torch_algo_utils.py | icml2020submission6857/metarl | 9b66cefa2b6bcb6a38096d629ce8853b47c7171d | [
"MIT"
] | 1 | 2020-02-24T03:04:23.000Z | 2020-02-24T03:04:23.000Z | """Test torch algo utility functions."""
import numpy as np
import pytest
import tensorflow as tf
import torch
import torch.nn.functional as F
import metarl.tf.misc.tensor_utils as tf_utils
import metarl.torch.algos._utils as torch_algo_utils
from tests.fixtures import TfGraphTestCase
def stack(d, arr):
"""Stack... | 42.508772 | 79 | 0.526482 | import numpy as np
import pytest
import tensorflow as tf
import torch
import torch.nn.functional as F
import metarl.tf.misc.tensor_utils as tf_utils
import metarl.torch.algos._utils as torch_algo_utils
from tests.fixtures import TfGraphTestCase
def stack(d, arr):
return np.repeat(np.expand_dims(arr, axis=0), rep... | true | true |
f70ea35f73bd2981d6bbb6766833e038e16308d4 | 23,711 | py | Python | src/sage/schemes/plane_curves/projective_curve.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/plane_curves/projective_curve.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/plane_curves/projective_curve.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | """
Projective plane curves over a general ring
AUTHORS:
- William Stein (2005-11-13)
- David Joyner (2005-11-13)
- David Kohel (2006-01)
- Moritz Minzlaff (2010-11)
"""
#*****************************************************************************
# Copyright (C) 2005 William Stein <wstein@gmail.com>
#
# ... | 32.17232 | 134 | 0.484374 |
from sage.interfaces.all import singular
from sage.misc.all import add, sage_eval
from sage.rings.all import degree_lowest_rational_function
from sage.schemes.projective.projective_space import is_ProjectiveSpace
from curve import Curve_generic_projective
class ProjectiveSpaceCurve_generic(Curve_generic_p... | true | true |
f70ea37895116b00771e48f3d3576aa318e30354 | 5,209 | py | Python | HelloWorldOpenCV.py | jhbrito/HelloWorlds | 7e2247ca7f312a516ce6a5054913d59e2f1de0f9 | [
"MIT"
] | 6 | 2020-02-14T15:18:14.000Z | 2022-02-22T15:40:33.000Z | HelloWorldOpenCV.py | jhbrito/HelloWorlds | 7e2247ca7f312a516ce6a5054913d59e2f1de0f9 | [
"MIT"
] | null | null | null | HelloWorldOpenCV.py | jhbrito/HelloWorlds | 7e2247ca7f312a516ce6a5054913d59e2f1de0f9 | [
"MIT"
] | null | null | null | # Demo with a few examples of using OpenCV functions and UI
# packages: opencv-python
# uses lena: https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png
import numpy as np
import cv2
print("Hello World OpenCV")
print("OpenCV Version:", cv2.__version__)
image = np.ones((256, 256), dtype="uint8")
i... | 29.429379 | 119 | 0.710501 |
import numpy as np
import cv2
print("Hello World OpenCV")
print("OpenCV Version:", cv2.__version__)
image = np.ones((256, 256), dtype="uint8")
image = image * 127
image[0:128, 0:128] = 0
image[128:, 128:] = 255
cv2.imshow("Image", image)
cv2.waitKey(0)
import os.path
if os.path.isfile('lena.png'):
print("T... | true | true |
f70ea378aaf48671277dab43c5ea3b4387cbb5a8 | 7,007 | py | Python | vitrage/datasources/zabbix/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 89 | 2015-09-30T21:42:17.000Z | 2022-03-28T16:31:19.000Z | vitrage/datasources/zabbix/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 4 | 2015-12-13T13:06:53.000Z | 2016-01-03T19:51:28.000Z | vitrage/datasources/zabbix/driver.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 43 | 2015-11-04T15:54:27.000Z | 2021-12-10T14:24:03.000Z | # Copyright 2016 - Nokia
#
# 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, sof... | 35.75 | 78 | 0.657057 |
from collections import namedtuple
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils as utils
from vitrage.common.constants import DatasourceAction
from vitrage.common.constants import DatasourceOpts as DSOpts
from vitrage.common.constants import DatasourcePropertie... | true | true |
f70ea3d37cea2ad796cf374b9a4ab9e73fc5c35c | 1,057 | py | Python | migrations/versions/5c80010c853a_posts_table.py | ChanForPres/Social-Blogging-App | 525c4588dfa50780a8b7c067111c101ade4e20f2 | [
"MIT"
] | null | null | null | migrations/versions/5c80010c853a_posts_table.py | ChanForPres/Social-Blogging-App | 525c4588dfa50780a8b7c067111c101ade4e20f2 | [
"MIT"
] | null | null | null | migrations/versions/5c80010c853a_posts_table.py | ChanForPres/Social-Blogging-App | 525c4588dfa50780a8b7c067111c101ade4e20f2 | [
"MIT"
] | null | null | null | """posts table
Revision ID: 5c80010c853a
Revises: 6ca7139bbbf2
Create Date: 2018-06-25 17:18:29.165993
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5c80010c853a'
down_revision = '6ca7139bbbf2'
branch_labels = None
depends_on = None
def upgrade():
# ##... | 27.815789 | 83 | 0.676443 | from alembic import op
import sqlalchemy as sa
revision = '5c80010c853a'
down_revision = '6ca7139bbbf2'
branch_labels = None
depends_on = None
def upgrade():
), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConst... | true | true |
f70ea4478d7916ef0eca7ea387f9da960ada87f9 | 27 | py | Python | src/euler_python_package/euler_python/medium/p255.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p255.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p255.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | def problem255():
pass
| 9 | 17 | 0.62963 | def problem255():
pass
| true | true |
f70ea613433f02ed837e0b8f877dedbe1826238c | 3,471 | py | Python | factory-ai-vision/EdgeSolution/modules/WebModule/backend/configs/api_router.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/configs/api_router.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/configs/api_router.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | """API router
"""
from django.conf.urls import url
from django.urls import path
from rest_framework.routers import DefaultRouter
from vision_on_edge.azure_app_insight.api import views as app_insight_views
from vision_on_edge.azure_parts.api import views as azure_part_views
from vision_on_edge.azure_settings.api impor... | 47.547945 | 79 | 0.803803 |
from django.conf.urls import url
from django.urls import path
from rest_framework.routers import DefaultRouter
from vision_on_edge.azure_app_insight.api import views as app_insight_views
from vision_on_edge.azure_parts.api import views as azure_part_views
from vision_on_edge.azure_settings.api import views as azure_s... | true | true |
f70ea783739509cd8b2366a0314a6db0627abca1 | 6,569 | py | Python | lib/sqlalchemy/orm/exc.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/exc.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/exc.py | petit87/sqlalchemy | 67d674bd63ca36ac32b23f96e2b19e9dac6b0863 | [
"MIT"
] | null | null | null | # orm/exc.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""SQLAlchemy ORM exceptions."""
from __future__ import annotations
from .. import exc... | 31.581731 | 76 | 0.642716 |
from __future__ import annotations
from .. import exc as sa_exc
from .. import util
from ..exc import MultipleResultsFound
from ..exc import NoResultFound
NO_STATE = (AttributeError, KeyError)
class StaleDataError(sa_exc.SQLAlchemyError):
ConcurrentModificationError = StaleDataError
class FlushErro... | true | true |
f70ea910deb64c851f94887e577c45916aab7cf2 | 12,652 | py | Python | doc/conf.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | 1 | 2019-03-09T14:23:48.000Z | 2019-03-09T14:23:48.000Z | doc/conf.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | null | null | null | doc/conf.py | gitter-badger/SoCo | 65977466057748ea522a6d8b7f2a649091485a07 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# soco documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 14 08:03:37 2015.
#
# 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
# autog... | 31.788945 | 79 | 0.710639 |
import sys
import os
import shlex
sys.path.insert(0, os.path.abspath('..'))
import soco
needs_sphinx = '1.3'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.extlinks',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.intersphinx',
'sphinx.ext.... | true | true |
f70eaaf12a9fe00936523a8b54e0345d5ae2821e | 768 | py | Python | src/deployable/__main__.py | cpuabuse/py-deployment-automation | aea0c48ac4c5a81f2e027c984ab65f911ad29d0d | [
"0BSD"
] | 1 | 2020-02-23T22:35:28.000Z | 2020-02-23T22:35:28.000Z | src/deployable/__main__.py | cpuabuse/py-deployment-automation | aea0c48ac4c5a81f2e027c984ab65f911ad29d0d | [
"0BSD"
] | null | null | null | src/deployable/__main__.py | cpuabuse/py-deployment-automation | aea0c48ac4c5a81f2e027c984ab65f911ad29d0d | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
"""
Main module for the deployable project.
"""
# Bootstrap to be able to perform absolute imports as standalone code
if __name__ == "__main__":
from absolute_import import absolute_import
absolute_import(file=__file__, name=__name__, path=__path__)
# Normal imports
from argparse import Argu... | 21.942857 | 109 | 0.763021 |
if __name__ == "__main__":
from absolute_import import absolute_import
absolute_import(file=__file__, name=__name__, path=__path__)
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from deployable.defaults.args import description, epilog
from typing import Any, Tuple
def get_args() -> Tuple[An... | true | true |
f70eab155736800811a7f28862b37c609211be8a | 4,889 | py | Python | src/cartpole.py | rish-16/gym-navmaze | cc21d730ec6ab1e96a4a1a8f602a5bbb951d2929 | [
"MIT"
] | 1 | 2021-06-10T13:40:09.000Z | 2021-06-10T13:40:09.000Z | src/cartpole.py | rish-16/gym-navmaze | cc21d730ec6ab1e96a4a1a8f602a5bbb951d2929 | [
"MIT"
] | null | null | null | src/cartpole.py | rish-16/gym-navmaze | cc21d730ec6ab1e96a4a1a8f602a5bbb951d2929 | [
"MIT"
] | 1 | 2021-06-10T13:40:11.000Z | 2021-06-10T13:40:11.000Z | import numpy as np
from collections import deque
import pickle
import torch
from utils import collect_trajectories, random_sample
from PPO import PPO
import matplotlib.pyplot as plt
from parallelEnv import *
import gym
env = gym.make("CartPole-v0")
env.reset()
env.seed(2)
obs_dim = env.observation_space.shape[0]
n_ac... | 36.759398 | 171 | 0.606668 | import numpy as np
from collections import deque
import pickle
import torch
from utils import collect_trajectories, random_sample
from PPO import PPO
import matplotlib.pyplot as plt
from parallelEnv import *
import gym
env = gym.make("CartPole-v0")
env.reset()
env.seed(2)
obs_dim = env.observation_space.shape[0]
n_ac... | true | true |
f70eab2e8fd598cbdc5417a99d3c40fb7b2434e9 | 643 | py | Python | lofo/infer_defaults.py | williamberrios/lofo-importance | 34967cf47dc1c2797d3a77f8926918ae91e4197a | [
"MIT"
] | 1 | 2020-10-31T10:05:45.000Z | 2020-10-31T10:05:45.000Z | lofo/infer_defaults.py | williamberrios/lofo-importance | 34967cf47dc1c2797d3a77f8926918ae91e4197a | [
"MIT"
] | null | null | null | lofo/infer_defaults.py | williamberrios/lofo-importance | 34967cf47dc1c2797d3a77f8926918ae91e4197a | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.preprocessing import LabelEncoder
from lightgbm import LGBMClassifier, LGBMRegressor
def infer_model(df, features, y, n_jobs):
model_class = LGBMRegressor
if len(np.unique(y)) == 2:
y = LabelEncoder().fit_transform(y)
model_class = LGBMClassifier
categorica... | 30.619048 | 83 | 0.720062 | import numpy as np
from sklearn.preprocessing import LabelEncoder
from lightgbm import LGBMClassifier, LGBMRegressor
def infer_model(df, features, y, n_jobs):
model_class = LGBMRegressor
if len(np.unique(y)) == 2:
y = LabelEncoder().fit_transform(y)
model_class = LGBMClassifier
categorica... | true | true |
f70eac78971c0c7d00f18c3d2c1b7bbe17c6918c | 11,789 | py | Python | napari/_vispy/overlays/axes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/overlays/axes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/overlays/axes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from vispy.scene.visuals import Compound, Line, Mesh, Text
from vispy.visuals.transforms import STTransform
from ...layers.shapes._shapes_utils import triangulate_ellipse
from ...utils.colormaps.standardize_color import transform_color
from ...utils.theme import get_theme
from ...utils.translations ... | 34.270349 | 79 | 0.573925 | import numpy as np
from vispy.scene.visuals import Compound, Line, Mesh, Text
from vispy.visuals.transforms import STTransform
from ...layers.shapes._shapes_utils import triangulate_ellipse
from ...utils.colormaps.standardize_color import transform_color
from ...utils.theme import get_theme
from ...utils.translations ... | true | true |
f70eacd9831e30421747847c4c2092590d7cb3b4 | 4,179 | py | Python | dataloader.py | PaperCodeReview/MoCo-TF | 1ea01b2d005de3e030229f79a37135468fa1631e | [
"MIT"
] | 22 | 2020-10-01T10:14:36.000Z | 2022-02-02T12:20:42.000Z | dataloader.py | PaperCodeReview/MoCo-TF | 1ea01b2d005de3e030229f79a37135468fa1631e | [
"MIT"
] | 2 | 2021-06-25T06:06:50.000Z | 2021-11-08T23:43:38.000Z | dataloader.py | PaperCodeReview/MoCo-TF | 1ea01b2d005de3e030229f79a37135468fa1631e | [
"MIT"
] | 4 | 2021-03-03T06:19:45.000Z | 2021-05-20T08:07:50.000Z | import os
import random
import numpy as np
import pandas as pd
import tensorflow as tf
from augment import Augment
AUTO = tf.data.experimental.AUTOTUNE
def set_dataset(task, data_path):
trainset = pd.read_csv(
os.path.join(
data_path, 'imagenet_trainset.csv'
)).value... | 36.657895 | 92 | 0.569275 | import os
import random
import numpy as np
import pandas as pd
import tensorflow as tf
from augment import Augment
AUTO = tf.data.experimental.AUTOTUNE
def set_dataset(task, data_path):
trainset = pd.read_csv(
os.path.join(
data_path, 'imagenet_trainset.csv'
)).value... | true | true |
f70eacda302b793da33c4fb5beb6b45c6cc933ec | 1,315 | py | Python | user_modeling.py | leeamen/k_means | dfa9cad22033c108e3988a99f4d58c685eb06921 | [
"MIT"
] | null | null | null | user_modeling.py | leeamen/k_means | dfa9cad22033c108e3988a99f4d58c685eb06921 | [
"MIT"
] | null | null | null | user_modeling.py | leeamen/k_means | dfa9cad22033c108e3988a99f4d58c685eb06921 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding:utf-8
import numpy as np
import logging
import mylog
import mykmeans as ml
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
def str2num(s):
a = ['very_low', 'Low', 'Middle', 'High']
for i in range(0, len(a)):
if a[i] == s:
return float(i)
if __name__ == '__mai... | 28.586957 | 108 | 0.641825 |
import numpy as np
import logging
import mylog
import mykmeans as ml
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
def str2num(s):
a = ['very_low', 'Low', 'Middle', 'High']
for i in range(0, len(a)):
if a[i] == s:
return float(i)
if __name__ == '__main__':
filename = './data/dat... | true | true |
f70eaf3e78788501749a3d605244c7e2c2fa2be1 | 448 | py | Python | creme/linear_model/__init__.py | Raul9595/creme | 39cec7ac27ccd40ff0a7bdd6bceaf7ce25c1a8da | [
"BSD-3-Clause"
] | 1 | 2020-07-27T03:06:46.000Z | 2020-07-27T03:06:46.000Z | creme/linear_model/__init__.py | 2torus/creme | bcc5e2a0155663a1f0ba779c68f23456695bcb54 | [
"BSD-3-Clause"
] | null | null | null | creme/linear_model/__init__.py | 2torus/creme | bcc5e2a0155663a1f0ba779c68f23456695bcb54 | [
"BSD-3-Clause"
] | null | null | null | """
Generalized linear models optimized with online gradient descent from :mod:`creme.optim`.
"""
from .fm import FMRegressor
from .lin_reg import LinearRegression
from .log_reg import LogisticRegression
from .pa import PAClassifier
from .pa import PARegressor
from .softmax import SoftmaxRegression
__all__ = [
'F... | 22.4 | 89 | 0.754464 | from .fm import FMRegressor
from .lin_reg import LinearRegression
from .log_reg import LogisticRegression
from .pa import PAClassifier
from .pa import PARegressor
from .softmax import SoftmaxRegression
__all__ = [
'FMRegressor',
'LinearRegression',
'LogisticRegression',
'PAClassifier',
'PARegresso... | true | true |
f70eb08931175461e6046102ac021119a7ea22c2 | 8,490 | py | Python | docs/conf.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | 1 | 2020-06-26T18:03:34.000Z | 2020-06-26T18:03:34.000Z | docs/conf.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | docs/conf.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# dedupe documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 10 11:27:59 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 31.444444 | 95 | 0.715901 |
import sys
import os
extensions = [
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'dedupe'
copyright = u'2018, Forest Gregg, Derek Eder... | true | true |
f70eb0922b08398271e740b375a058194fb88a63 | 10,033 | py | Python | auth-api/src/auth_api/models/user.py | vysakh-menon-aot/sbc-auth | b5c18df3b7586cb7d9761f7fc0809cb2cbb3b096 | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/models/user.py | vysakh-menon-aot/sbc-auth | b5c18df3b7586cb7d9761f7fc0809cb2cbb3b096 | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/models/user.py | vysakh-menon-aot/sbc-auth | b5c18df3b7586cb7d9761f7fc0809cb2cbb3b096 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 43.4329 | 118 | 0.653344 |
import datetime
from flask import current_app
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String, and_, or_
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from auth_api.utils.enums import AccessType, LoginSource, Status, UserStatus
from... | true | true |
f70eb14a7a606f28ca7a0378c580389cd746f583 | 213 | py | Python | tests/test.py | JamesRunnalls/netcdf2geotiff | 69ed4232998ce45bcb47035a077009ad0882f5ec | [
"MIT"
] | null | null | null | tests/test.py | JamesRunnalls/netcdf2geotiff | 69ed4232998ce45bcb47035a077009ad0882f5ec | [
"MIT"
] | null | null | null | tests/test.py | JamesRunnalls/netcdf2geotiff | 69ed4232998ce45bcb47035a077009ad0882f5ec | [
"MIT"
] | null | null | null | from netcdf2geotiff import rgb_geotiff, singleband_geotiff
rgb_geotiff("test3.nc", "test3.tif", "RED", "GREEN", "BLUE", "lat", "lon")
singleband_geotiff("test3.nc", "tests3.tif", "IDEPIX_SNOW_ICE", "lat", "lon") | 42.6 | 77 | 0.713615 | from netcdf2geotiff import rgb_geotiff, singleband_geotiff
rgb_geotiff("test3.nc", "test3.tif", "RED", "GREEN", "BLUE", "lat", "lon")
singleband_geotiff("test3.nc", "tests3.tif", "IDEPIX_SNOW_ICE", "lat", "lon") | true | true |
f70eb1feadb7d4ea843f887e4935a9b29163f734 | 1,071 | py | Python | python/src/aoc/year2015/day6.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | 1 | 2021-02-16T21:30:04.000Z | 2021-02-16T21:30:04.000Z | python/src/aoc/year2015/day6.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | python/src/aoc/year2015/day6.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | from collections import defaultdict
from aoc.util import load_input
def turn(d, fun, sxy, exy):
sx, sy = map(int, sxy.split(","))
ex, ey = map(int, exy.split(","))
for x in range(sx, ex + 1):
for y in range(sy, ey + 1):
d[(x, y)] = fun(d[(x, y)])
def run(data, toggle, turn_on, turn_... | 26.121951 | 80 | 0.573296 | from collections import defaultdict
from aoc.util import load_input
def turn(d, fun, sxy, exy):
sx, sy = map(int, sxy.split(","))
ex, ey = map(int, exy.split(","))
for x in range(sx, ex + 1):
for y in range(sy, ey + 1):
d[(x, y)] = fun(d[(x, y)])
def run(data, toggle, turn_on, turn_... | true | true |
f70eb2beb7c9126a39c5a492ce778317fcf5af57 | 73,671 | py | Python | lexer_parser/domas_parser.py | franzbarron/proyecto-compis | 29b3b9a588a92f5257bc3b1bb646734b7ace985b | [
"MIT"
] | null | null | null | lexer_parser/domas_parser.py | franzbarron/proyecto-compis | 29b3b9a588a92f5257bc3b1bb646734b7ace985b | [
"MIT"
] | null | null | null | lexer_parser/domas_parser.py | franzbarron/proyecto-compis | 29b3b9a588a92f5257bc3b1bb646734b7ace985b | [
"MIT"
] | null | null | null | from sly import Parser
from sly.yacc import _decorator as _
from .domas_lexer import DomasLexer
from .domas_quadruples import Quadruple
from .domas_errors import *
from . import domas_semantic_cube as sm
import json # to debug only
import os
import copy
os.system('color')
class DomasParser(Parser):
# Parser dir... | 43.773619 | 213 | 0.565392 | from sly import Parser
from sly.yacc import _decorator as _
from .domas_lexer import DomasLexer
from .domas_quadruples import Quadruple
from .domas_errors import *
from . import domas_semantic_cube as sm
import json
import os
import copy
os.system('color')
class DomasParser(Parser):
tokens = DomasLexer.to... | true | true |
f70eb2c0d33d0d03e11a8847b577c694fe9dd459 | 1,322 | py | Python | tracdap-runtime/python/test/tracdap_examples/test_chaining.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | null | null | null | tracdap-runtime/python/test/tracdap_examples/test_chaining.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | null | null | null | tracdap-runtime/python/test/tracdap_examples/test_chaining.py | martin-traverse/tracdap | 2df2f08bee352f4f5188953efe5a33aa1ae51f2d | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Accenture Global Solutions Limited
#
# 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 ... | 28.12766 | 75 | 0.706505 |
import unittest
import pathlib
import sys
import tracdap.rt.launch as launch
_ROOT_DIR = pathlib.Path(__file__).parent \
.joinpath("../../../..") \
.resolve()
_EXAMPLES_DIR = _ROOT_DIR.joinpath("examples/models/python")
class ChainingExample(unittest.TestCase):
def test_chaining(self):
... | true | true |
f70eb2d8117df4c61263da019a776ba2536c2d96 | 4,243 | py | Python | day08/run.py | kung-foo/aoc2021 | ce3111d50b7b3354331b8dc546b13c7fe8882ba9 | [
"Apache-2.0"
] | null | null | null | day08/run.py | kung-foo/aoc2021 | ce3111d50b7b3354331b8dc546b13c7fe8882ba9 | [
"Apache-2.0"
] | null | null | null | day08/run.py | kung-foo/aoc2021 | ce3111d50b7b3354331b8dc546b13c7fe8882ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import random
import numpy as np
src = open("input.txt", "r").readlines()
example = """
be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc
fgaebd cg bdaec... | 26.51875 | 111 | 0.525572 |
import os
import sys
import random
import numpy as np
src = open("input.txt", "r").readlines()
example = """
be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe
edbfga begcd cbg gc gcadebf fbgde acbgfd abcde gfcbed gfec | fcgedb cgb dgebacf gc
fgaebd cg bdaec gdafb agbcfd gdcbef b... | true | true |
f70eb2e3a9de09a2e1bdb89d0cfb67ccb56d4e41 | 7,146 | py | Python | Tests/GUI/DMachineSetup/test_DMachineSetup.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Tests/GUI/DMachineSetup/test_DMachineSetup.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Tests/GUI/DMachineSetup/test_DMachineSetup.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@date Created on Thu May 18 14:35:34 2017
@copyright (C) 2015-2016 EOMYS ENGINEERING.
@author: pierre_b
"""
from os.path import join, isfile
from os import remove
import sys
from unittest import TestCase
from ddt import ddt, data
import mock # for unittest of raw_input
from PyQt5 import Q... | 39.480663 | 86 | 0.687378 |
from os.path import join, isfile
from os import remove
import sys
from unittest import TestCase
from ddt import ddt, data
import mock
from PyQt5 import QtWidgets
from pyleecan.Classes.MachineSyRM import MachineSyRM
from pyleecan.Classes.MachineIPMSM import MachineIPMSM
from pyleecan.Classes.MachineDFIM import Mac... | true | true |
f70eb2f3401ca84927cd6ad2318eeb8439e46c72 | 2,814 | py | Python | core/queue/views.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 35 | 2019-03-12T23:59:10.000Z | 2021-04-05T15:07:38.000Z | core/queue/views.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 365 | 2019-03-12T23:40:39.000Z | 2022-02-10T11:07:26.000Z | core/queue/views.py | lottspot/prevention-point | e4d5eaa437c3e979e8585bdada4efd33e995e39e | [
"MIT"
] | 20 | 2019-03-12T23:36:25.000Z | 2021-12-30T00:05:42.000Z | import datetime
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from core.permissions import DjangoModelPermissions
from core.visits.serializer import PopulatedVisitSerializer
from core.models import Visit, FrontDeskEvent,... | 40.2 | 98 | 0.657783 | import datetime
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from core.permissions import DjangoModelPermissions
from core.visits.serializer import PopulatedVisitSerializer
from core.models import Visit, FrontDeskEvent,... | true | true |
f70eb3a29c6a510eca3947f79787ed0abd7f6655 | 732 | py | Python | day01_Sonar_Sweep/day01.py | anolivei/advent_of_code_2021 | 1eac988d37bf754bbee68fad2e927914351a5a2b | [
"MIT"
] | null | null | null | day01_Sonar_Sweep/day01.py | anolivei/advent_of_code_2021 | 1eac988d37bf754bbee68fad2e927914351a5a2b | [
"MIT"
] | null | null | null | day01_Sonar_Sweep/day01.py | anolivei/advent_of_code_2021 | 1eac988d37bf754bbee68fad2e927914351a5a2b | [
"MIT"
] | null | null | null | def open_input():
with open("input.txt") as fd:
array = fd.read().splitlines()
array = list(map(int, array))
return array
def part_one(array):
lenght = len(array)
increased = 0
for i in range(0, lenght - 1):
if array[i] < array[i + 1]:
increased += 1
print("part... | 22.875 | 57 | 0.543716 | def open_input():
with open("input.txt") as fd:
array = fd.read().splitlines()
array = list(map(int, array))
return array
def part_one(array):
lenght = len(array)
increased = 0
for i in range(0, lenght - 1):
if array[i] < array[i + 1]:
increased += 1
print("part... | true | true |
f70eb3de404bce1c3ea4c27a5b70915529f3a386 | 6,153 | py | Python | sdk/python/pulumi_azure_native/customproviders/v20180901preview/get_custom_resource_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/customproviders/v20180901preview/get_custom_resource_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/customproviders/v20180901preview/get_custom_resource_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 35.982456 | 174 | 0.653827 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetCustomResourceProviderResult',
'AwaitableGetCustomResourceProviderResult',
'get_custom_resource_provider',
]
@pulumi... | true | true |
f70eb40817dabb9bff5e70b4866289c7586fcf23 | 1,189 | py | Python | plugins/action/gitlab_modwrap.py | sma-de/ansible-collections-gitlab | 5da99b04722fc016d3e8589635fcbb3579dcfda2 | [
"BSD-3-Clause"
] | null | null | null | plugins/action/gitlab_modwrap.py | sma-de/ansible-collections-gitlab | 5da99b04722fc016d3e8589635fcbb3579dcfda2 | [
"BSD-3-Clause"
] | null | null | null | plugins/action/gitlab_modwrap.py | sma-de/ansible-collections-gitlab | 5da99b04722fc016d3e8589635fcbb3579dcfda2 | [
"BSD-3-Clause"
] | null | null | null |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
##from ansible.errors import AnsibleOptionsError, AnsibleModuleError##, AnsibleError
####from ansible.module_utils._text import to_native
from ansible.module_utils.six import iteritems, string_types
from ansi... | 25.847826 | 96 | 0.699748 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import collections
ionModule(GitlabBase):
def __init__(self, *args, **kwargs):
super(ActionModule, self).__init__(*args, **kwargs)
self._supports_check_mode = False
self._supports_async = False
... | true | true |
f70eb5b9f0829e7189fca574a45e2c0d95713fd9 | 2,964 | py | Python | python/tests/test_oberon.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | null | null | null | python/tests/test_oberon.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | null | null | null | python/tests/test_oberon.py | tmarkovski/okapi | 1ce36d2a82bb0e409a5183cd116d3a9eb474fc9f | [
"Apache-2.0"
] | null | null | null | import unittest
from okapi.proto.okapi.security.v1 import CreateOberonKeyRequest, CreateOberonTokenRequest, CreateOberonProofRequest, \
VerifyOberonProofRequest, UnBlindOberonTokenRequest, BlindOberonTokenRequest
from okapi.wrapper import Oberon
class KeyTests(unittest.TestCase):
def test_oberon_demo(self):
... | 48.590164 | 119 | 0.721997 | import unittest
from okapi.proto.okapi.security.v1 import CreateOberonKeyRequest, CreateOberonTokenRequest, CreateOberonProofRequest, \
VerifyOberonProofRequest, UnBlindOberonTokenRequest, BlindOberonTokenRequest
from okapi.wrapper import Oberon
class KeyTests(unittest.TestCase):
def test_oberon_demo(self):
... | true | true |
f70eb60e7035a3d1c3d3275fedadb650fd20fe9f | 3,030 | py | Python | searchmethods/modularGA.py | esnet/hps-rl | 8426652e622394a955a44c42201e2204f6bfa0f2 | [
"BSD-3-Clause-LBNL"
] | null | null | null | searchmethods/modularGA.py | esnet/hps-rl | 8426652e622394a955a44c42201e2204f6bfa0f2 | [
"BSD-3-Clause-LBNL"
] | null | null | null | searchmethods/modularGA.py | esnet/hps-rl | 8426652e622394a955a44c42201e2204f6bfa0f2 | [
"BSD-3-Clause-LBNL"
] | null | null | null |
import numpy, random
class Individual:
def __init__(self,genome, llimits =[], ulimits=[], type=[], LEN = 1,fitness_func = None):
if genome is None:
self.genome = numpy.zeros(LEN,dtype=float)
for gene in range(LEN):
if type[gene] == "integer":
... | 34.044944 | 133 | 0.59703 |
import numpy, random
class Individual:
def __init__(self,genome, llimits =[], ulimits=[], type=[], LEN = 1,fitness_func = None):
if genome is None:
self.genome = numpy.zeros(LEN,dtype=float)
for gene in range(LEN):
if type[gene] == "integer":
... | true | true |
f70eb629524c29581304d4058b938e52261dca03 | 10,701 | py | Python | kubernetes_asyncio/client/models/v1_topology_spread_constraint.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_topology_spread_constraint.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_topology_spread_constraint.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.19.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 51.447115 | 965 | 0.680404 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1TopologySpreadConstraint(object):
openapi_types = {
'label_selector': 'V1LabelSelector',
'max_skew': 'int',
'topology_key': 'str',
'when_unsatisfiable': 'str'
}... | true | true |
f70eb689c0446ccc43bdd2bc306542d157e6219f | 589 | py | Python | splango/urls.py | shimon/Splango | a89408b8b62d631763d42e049dd1b7d6ef72b02f | [
"MIT"
] | 3 | 2016-06-02T10:18:57.000Z | 2022-03-16T06:10:21.000Z | splango/urls.py | shimon/Splango | a89408b8b62d631763d42e049dd1b7d6ef72b02f | [
"MIT"
] | null | null | null | splango/urls.py | shimon/Splango | a89408b8b62d631763d42e049dd1b7d6ef72b02f | [
"MIT"
] | 1 | 2022-03-16T06:10:33.000Z | 2022-03-16T06:10:33.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns(
'splango.views',
url(r'^confirm_human/$', 'confirm_human', name="splango-confirm-human"),
url(r'^admin/$', 'experiments_overview', name="splango-admin"),
url(r'^admin/exp/(?P<expname>[^/]+)/$', 'experiment_detail', name="splango-experimen... | 39.266667 | 128 | 0.629881 | from django.conf.urls.defaults import *
urlpatterns = patterns(
'splango.views',
url(r'^confirm_human/$', 'confirm_human', name="splango-confirm-human"),
url(r'^admin/$', 'experiments_overview', name="splango-admin"),
url(r'^admin/exp/(?P<expname>[^/]+)/$', 'experiment_detail', name="splango-experimen... | true | true |
f70eb6f89adb3426524735b14874f388558e4b0c | 5,289 | py | Python | data_creation.py | Bruce-zxy/deep-study-lenet5 | bba6531c9234c077107f79ff852f141cfed58229 | [
"MIT"
] | null | null | null | data_creation.py | Bruce-zxy/deep-study-lenet5 | bba6531c9234c077107f79ff852f141cfed58229 | [
"MIT"
] | null | null | null | data_creation.py | Bruce-zxy/deep-study-lenet5 | bba6531c9234c077107f79ff852f141cfed58229 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import random
import numpy as np
import pandas as pd
import h5py
import matplotlib.pyplot as plt
from math import cos, sin, atan2, sqrt, pi, radians, degrees, ceil, isnan
from skimage import io, transform
BASE_DIR = os.path.dirname(os.path.abspath(__f... | 31.861446 | 76 | 0.636226 |
import os
import sys
import random
import numpy as np
import pandas as pd
import h5py
import matplotlib.pyplot as plt
from math import cos, sin, atan2, sqrt, pi, radians, degrees, ceil, isnan
from skimage import io, transform
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
TRAIN_CSV_... | true | true |
f70eb7f417149b9a8081bb318f4066b6168a6304 | 1,289 | py | Python | 362 Design Hit Counter.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 872 | 2015-06-15T12:02:41.000Z | 2022-03-30T08:44:35.000Z | 362 Design Hit Counter.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 8 | 2015-06-21T15:11:59.000Z | 2022-02-01T11:22:34.000Z | 362 Design Hit Counter.py | ChiFire/legend_LeetCode | 93fe97fef7e929fdbdc25fbb53955d44e14ecff8 | [
"MIT"
] | 328 | 2015-06-28T03:10:35.000Z | 2022-03-29T11:05:28.000Z | """
Premium Question
"""
from collections import deque
__author__ = 'Daniel'
class HitCounter(object):
def __init__(self):
"""
Initialize your data structure here.
calls are being made to the system in chronological order.
It is possible that several hits arrive roughly at the sa... | 26.854167 | 105 | 0.612878 | from collections import deque
__author__ = 'Daniel'
class HitCounter(object):
def __init__(self):
self.q = deque()
def hit(self, timestamp):
self.pop(timestamp)
self.q.append(timestamp)
def getHits(self, timestamp):
self.pop(timestamp)
return len(self.q)
def... | true | true |
f70eb992a38c3e76ec1dd03ed607975174757fd1 | 5,136 | py | Python | pyinfra/operations/yum.py | vamshi091211/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | 1 | 2022-03-24T05:44:45.000Z | 2022-03-24T05:44:45.000Z | pyinfra/operations/yum.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | null | null | null | pyinfra/operations/yum.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | 1 | 2021-11-12T18:36:01.000Z | 2021-11-12T18:36:01.000Z | '''
Manage yum packages and repositories. Note that yum package names are case-sensitive.
'''
from __future__ import unicode_literals
from pyinfra.api import operation
from . import files
from .util.packaging import ensure_packages, ensure_rpm, ensure_yum_repo
@operation
def key(state, host, key):
'''
Add ... | 27.319149 | 85 | 0.626558 |
from __future__ import unicode_literals
from pyinfra.api import operation
from . import files
from .util.packaging import ensure_packages, ensure_rpm, ensure_yum_repo
@operation
def key(state, host, key):
yield 'rpm --import {0}'.format(key)
@operation
def repo(
state, host, name, baseurl=None,
pres... | true | true |
f70eba1aa1744645a51c91f874da542a669aeca5 | 168 | py | Python | setup.py | jovanzac/Server | 90932560b61f378122355bb8df18309b245858d5 | [
"MIT"
] | null | null | null | setup.py | jovanzac/Server | 90932560b61f378122355bb8df18309b245858d5 | [
"MIT"
] | null | null | null | setup.py | jovanzac/Server | 90932560b61f378122355bb8df18309b245858d5 | [
"MIT"
] | null | null | null | from cx_Freeze import setup, Executable
setup(name = "Server" ,
version = "1.0" ,
description = "" ,
executables = [Executable("server.py")])
| 21 | 46 | 0.583333 | from cx_Freeze import setup, Executable
setup(name = "Server" ,
version = "1.0" ,
description = "" ,
executables = [Executable("server.py")])
| true | true |
f70eba2ea25aab68aa58ed217078ed6007e84dc0 | 23,807 | py | Python | conans/client/build/cmake.py | sigiesec/conan | f966d516452380918437888811bc833c804dac39 | [
"MIT"
] | null | null | null | conans/client/build/cmake.py | sigiesec/conan | f966d516452380918437888811bc833c804dac39 | [
"MIT"
] | null | null | null | conans/client/build/cmake.py | sigiesec/conan | f966d516452380918437888811bc833c804dac39 | [
"MIT"
] | null | null | null | import os
import platform
from collections import OrderedDict
from itertools import chain
from conans.client import defs_to_string, join_arguments
from conans.client.build.cppstd_flags import cppstd_flag
from conans.client.tools import cross_building
from conans.client.tools.oss import get_cross_building_settings
fro... | 42.588551 | 119 | 0.604192 | import os
import platform
from collections import OrderedDict
from itertools import chain
from conans.client import defs_to_string, join_arguments
from conans.client.build.cppstd_flags import cppstd_flag
from conans.client.tools import cross_building
from conans.client.tools.oss import get_cross_building_settings
fro... | true | true |
f70eba7ac72db4241c482950c5d46e65d867d233 | 2,161 | py | Python | apps/erms/api.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | 7 | 2020-02-20T13:24:40.000Z | 2022-01-28T19:36:04.000Z | apps/erms/api.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | 15 | 2020-04-28T13:09:02.000Z | 2021-11-03T15:21:24.000Z | apps/erms/api.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | 4 | 2020-02-20T13:48:30.000Z | 2021-03-19T00:33:34.000Z | import urllib.parse
import requests
class ERMSError(Exception):
pass
class ERMS(object):
"""
Possible queries:
/object?id=eq.574
/object?id=in.(574,575)
"""
# endpoints
EP_OBJECT = 'object'
EP_IDENTITY = 'identity'
EP_CONSORTIUM = 'consortium'
EP_CONSORTIUM_MEMBER = ... | 28.064935 | 72 | 0.61777 | import urllib.parse
import requests
class ERMSError(Exception):
pass
class ERMS(object):
EP_OBJECT = 'object'
EP_IDENTITY = 'identity'
EP_CONSORTIUM = 'consortium'
EP_CONSORTIUM_MEMBER = 'consortium_member'
EP_ACQUISITION = 'acquisition'
EP_PROCUREMENT = 'procurement'
EP_OFF... | true | true |
f70ebad00452b2d47ad5070a859d615e6a790ba0 | 5,906 | py | Python | dash/html/Code.py | sthagen/plotly-dash | 4a9412efe5229809016eee9a5f1c50f882720c4c | [
"MIT"
] | null | null | null | dash/html/Code.py | sthagen/plotly-dash | 4a9412efe5229809016eee9a5f1c50f882720c4c | [
"MIT"
] | null | null | null | dash/html/Code.py | sthagen/plotly-dash | 4a9412efe5229809016eee9a5f1c50f882720c4c | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Code(Component):
"""A Code component.
Code is a wrapper for the <code> HTML5 element.
For detailed attribute info see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code
... | 31.752688 | 84 | 0.596173 |
from dash.development.base_component import Component, _explicitize_args
class Code(Component):
_children_props = []
_base_nodes = ["children"]
_namespace = "dash_html_components"
_type = "Code"
@_explicitize_args
def __init__(
self,
children=None,
id=Component.UNDE... | true | true |
f70ebb69800c57b924e20d307a2ea6cd4f9f431c | 11,439 | py | Python | python/train_model.py | skinnider/low-data-generative-models | 6e743b6d1ba3265f58fcbd33f2c60e633cf25999 | [
"MIT"
] | 10 | 2021-02-01T06:21:52.000Z | 2022-03-02T23:59:30.000Z | python/train_model.py | skinnider/low-data-generative-models | 6e743b6d1ba3265f58fcbd33f2c60e633cf25999 | [
"MIT"
] | 1 | 2021-09-21T02:38:07.000Z | 2021-09-21T02:38:07.000Z | python/train_model.py | skinnider/low-data-generative-models | 6e743b6d1ba3265f58fcbd33f2c60e633cf25999 | [
"MIT"
] | 5 | 2021-04-16T18:11:48.000Z | 2021-12-08T07:21:09.000Z | """
Train a language model to generate SMILES.
"""
import argparse
import os
import numpy as np
import pandas as pd
import random
import sys
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from tqdm import tqdm
# suppress Chem.MolFromSmiles error output
from rdki... | 39.309278 | 79 | 0.652417 |
import argparse
import os
import numpy as np
import pandas as pd
import random
import sys
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from tqdm import tqdm
from rdkit import rdBase
rdBase.DisableLog('rdApp.error')
git_dir = os.path.expanduser("~/git/low-da... | true | true |
f70ebc9c8b640280b26f6fd66deed90179dd2995 | 31,646 | py | Python | pytype/analyze.py | Hirni-Meshram4/pytype | 24b04237c15822b26f51c545646e4e5fff1ab709 | [
"Apache-2.0"
] | null | null | null | pytype/analyze.py | Hirni-Meshram4/pytype | 24b04237c15822b26f51c545646e4e5fff1ab709 | [
"Apache-2.0"
] | null | null | null | pytype/analyze.py | Hirni-Meshram4/pytype | 24b04237c15822b26f51c545646e4e5fff1ab709 | [
"Apache-2.0"
] | null | null | null | """Code for checking and inferring types."""
import collections
import logging
import re
import subprocess
from typing import Any, Dict, Union
from pytype import abstract
from pytype import abstract_utils
from pytype import convert_structural
from pytype import debug
from pytype import function
from pytype import met... | 41.694335 | 80 | 0.684573 |
import collections
import logging
import re
import subprocess
from typing import Any, Dict, Union
from pytype import abstract
from pytype import abstract_utils
from pytype import convert_structural
from pytype import debug
from pytype import function
from pytype import metrics
from pytype import special_builtins
from... | true | true |
f70ebcc7d351e260c5318ca161f5f74fcdefc39f | 2,579 | py | Python | item_44_pickle_copyreg.py | nickaigi/effective_python_tips | 1a68b6eaed2e946b003c0cd0bdea03e79b8e8990 | [
"Unlicense"
] | null | null | null | item_44_pickle_copyreg.py | nickaigi/effective_python_tips | 1a68b6eaed2e946b003c0cd0bdea03e79b8e8990 | [
"Unlicense"
] | null | null | null | item_44_pickle_copyreg.py | nickaigi/effective_python_tips | 1a68b6eaed2e946b003c0cd0bdea03e79b8e8990 | [
"Unlicense"
] | null | null | null | """ pickle can serialized python objects into a stream of bytes and
deserialize bytes back into objects.
Note:
by design, pickle is unsafe!
"""
import pickle
state_path = 'game_state.bin'
class GameState(object):
def __init__(self):
self.level = 0
self.lives = 4
def save_game(state):
... | 20.468254 | 73 | 0.632803 |
import pickle
state_path = 'game_state.bin'
class GameState(object):
def __init__(self):
self.level = 0
self.lives = 4
def save_game(state):
with open(state_path, 'wb') as f:
pickle.dump(state, f)
def load_game():
state_after = {}
with open(state_path, 'rb') as f:
... | true | true |
f70ebd3a3a9e6e7198ad4ce295f8d246601bb1e8 | 5,826 | py | Python | homeassistant/components/push/camera.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/push/camera.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/push/camera.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Camera platform that receives images through HTTP POST."""
from __future__ import annotations
import asyncio
from collections import deque
from datetime import timedelta
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.components import webhook
from homeassistant.comp... | 30.825397 | 87 | 0.656368 | from __future__ import annotations
import asyncio
from collections import deque
from datetime import timedelta
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.components import webhook
from homeassistant.components.camera import PLATFORM_SCHEMA, STATE_IDLE, Camera
from ... | true | true |
f70ebd9d986c52d7cd9e9a67cef2870a625bb652 | 3,080 | py | Python | scripts/eval_bleu.py | nng555/fairseq | c9730a125825a85f33042e1b9fd1959b8ca829e5 | [
"MIT"
] | 2 | 2020-10-05T08:52:01.000Z | 2021-03-03T15:26:35.000Z | scripts/eval_bleu.py | nng555/fairseq | c9730a125825a85f33042e1b9fd1959b8ca829e5 | [
"MIT"
] | null | null | null | scripts/eval_bleu.py | nng555/fairseq | c9730a125825a85f33042e1b9fd1959b8ca829e5 | [
"MIT"
] | null | null | null | import os
import sys
import subprocess
import hydra
from omegaconf import DictConfig
from hydra import slurm_utils
@hydra.main(config_path='/h/nng/conf/robust/config.yaml')
def gen_neighborhood_labels(cfg: DictConfig):
base_path = '/h/nng/data'
model_data_path = os.path.join(base_path, cfg.data.task, cfg.eval... | 40.526316 | 113 | 0.593831 | import os
import sys
import subprocess
import hydra
from omegaconf import DictConfig
from hydra import slurm_utils
@hydra.main(config_path='/h/nng/conf/robust/config.yaml')
def gen_neighborhood_labels(cfg: DictConfig):
base_path = '/h/nng/data'
model_data_path = os.path.join(base_path, cfg.data.task, cfg.eval... | true | true |
f70ebea5539a99338b6dc9117844ec03bdd9efa1 | 79,789 | py | Python | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_01_01_preview/operations/_deployments_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.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 ... | 51.443585 | 254 | 0.660492 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
f70ec1157e54153c23a33efa2de815ddfff14a48 | 4,440 | py | Python | src/helper/trainer.py | rlaehgns5399/GoogLeNet-Inception-tf | eb9597634eec9a7b511e967ad8c7b2552563755f | [
"MIT"
] | 3 | 2018-12-02T13:34:32.000Z | 2019-03-18T03:23:37.000Z | src/helper/trainer.py | rlaehgns5399/GoogLeNet-Inception-tf | eb9597634eec9a7b511e967ad8c7b2552563755f | [
"MIT"
] | null | null | null | src/helper/trainer.py | rlaehgns5399/GoogLeNet-Inception-tf | eb9597634eec9a7b511e967ad8c7b2552563755f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: trainer.py
# Author: Qian Ge <geqian1001@gmail.com>
import os
import numpy as np
import tensorflow as tf
def display(global_step,
step,
scaler_sum_list,
name_list,
collection,
summary_val=None,
... | 33.134328 | 80 | 0.547072 |
import os
import numpy as np
import tensorflow as tf
def display(global_step,
step,
scaler_sum_list,
name_list,
collection,
summary_val=None,
summary_writer=None,
):
print('[step: {}]'.format(global_step), end='')
for val... | true | true |
f70ec119a082e7c27fa7682d87edbb9dac979d7d | 601 | py | Python | ndg/__init__.py | philipkershaw/ndg_xacml | f24ccbb4d4c053c585b0369dfe5a5949d49f9715 | [
"BSD-3-Clause"
] | null | null | null | ndg/__init__.py | philipkershaw/ndg_xacml | f24ccbb4d4c053c585b0369dfe5a5949d49f9715 | [
"BSD-3-Clause"
] | null | null | null | ndg/__init__.py | philipkershaw/ndg_xacml | f24ccbb4d4c053c585b0369dfe5a5949d49f9715 | [
"BSD-3-Clause"
] | null | null | null | """NDG XACML ndg namespace package
NERC DataGrid
This is a setuptools namespace_package. DO NOT place any other
code in this file! There is no guarantee that it will be installed
with easy_install. See:
http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
... for details.
"""
__author__ = "P J K... | 30.05 | 69 | 0.768719 | __author__ = "P J Kershaw"
__date__ = "19/02/10"
__copyright__ = "(C) 2010 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = '$Id$'
__import__('pkg_resources').declare_namespace(__name__)
| true | true |
f70ec43dc91c15bd7888f7714dfbcacfc1d5d148 | 4,513 | py | Python | fastai/torch_imports.py | CalebEverett/fastai-dl2 | 64d23592eddca6ca1f3647e73c319e97c8eb392b | [
"Apache-2.0"
] | 4 | 2018-03-29T20:47:24.000Z | 2019-05-06T12:31:11.000Z | fastai/torch_imports.py | CalebEverett/fastai-dl2 | 64d23592eddca6ca1f3647e73c319e97c8eb392b | [
"Apache-2.0"
] | null | null | null | fastai/torch_imports.py | CalebEverett/fastai-dl2 | 64d23592eddca6ca1f3647e73c319e97c8eb392b | [
"Apache-2.0"
] | null | null | null | import os
import torch, torchvision, torchtext
from torch import nn, cuda, backends, FloatTensor, LongTensor, optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import Dataset, TensorDataset
from torch.nn.init import kaiming_uniform, kaiming_normal
from torchvision.transform... | 46.525773 | 122 | 0.739198 | import os
import torch, torchvision, torchtext
from torch import nn, cuda, backends, FloatTensor, LongTensor, optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import Dataset, TensorDataset
from torch.nn.init import kaiming_uniform, kaiming_normal
from torchvision.transform... | true | true |
f70ec5c93336e5b029a6279f82499cd519691765 | 6,514 | py | Python | models/model.py | qq456cvb/CPPF | 79366978854ae18b14c69ac850ea64b9dc286081 | [
"MIT"
] | 23 | 2022-03-06T12:01:00.000Z | 2022-03-31T19:26:39.000Z | models/model.py | qq456cvb/CPPF | 79366978854ae18b14c69ac850ea64b9dc286081 | [
"MIT"
] | null | null | null | models/model.py | qq456cvb/CPPF | 79366978854ae18b14c69ac850ea64b9dc286081 | [
"MIT"
] | 2 | 2022-03-23T07:14:13.000Z | 2022-03-24T07:18:55.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from .sprin import GlobalInfoProp, SparseSO3Conv
import numpy as np
class ResLayer(torch.nn.Module):
def __init__(self, dim_in, dim_out, bn=False) -> None:
super().__init__()
assert(bn is False)
self.fc1 = torch.nn.Linear(d... | 47.202899 | 202 | 0.57553 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .sprin import GlobalInfoProp, SparseSO3Conv
import numpy as np
class ResLayer(torch.nn.Module):
def __init__(self, dim_in, dim_out, bn=False) -> None:
super().__init__()
assert(bn is False)
self.fc1 = torch.nn.Linear(d... | true | true |
f70ec5d7df1d46b90aac95d7005cb457c693a297 | 4,095 | py | Python | ea_sim/visualization_adv_tasks/convert_history_to_archive.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | 1 | 2021-08-03T10:52:20.000Z | 2021-08-03T10:52:20.000Z | ea_sim/visualization_adv_tasks/convert_history_to_archive.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | null | null | null | ea_sim/visualization_adv_tasks/convert_history_to_archive.py | lis-epfl/Tensoft-G21 | 7a83c5dabc12906c0a6bd1da0a28a131e9d5e144 | [
"Apache-2.0"
] | 1 | 2021-09-18T07:23:35.000Z | 2021-09-18T07:23:35.000Z | import argparse
import json
import numpy as np
import os
import subprocess
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from params_conf import N_MODULES, MIN_NUM_MODULES, STIFF_TABLE
from utils import parse_robot_string
def convert_h_to_arch(h_file, morph_file, best_funct... | 45.5 | 119 | 0.620757 | import argparse
import json
import numpy as np
import os
import subprocess
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from params_conf import N_MODULES, MIN_NUM_MODULES, STIFF_TABLE
from utils import parse_robot_string
def convert_h_to_arch(h_file, morph_file, best_funct... | true | true |
f70ec64b9e31daafd1fb2f1ca0a900fb5ba86171 | 3,473 | py | Python | pyexcel_xls/xlsw.py | pyexcel/pyexcel-xls | 995cfd273d5360947a528ff3a1ed3f9e52a429ad | [
"BSD-3-Clause"
] | 40 | 2016-05-18T20:09:39.000Z | 2022-02-09T06:39:41.000Z | pyexcel_xls/xlsw.py | wenxuefeng3930/pyexcel-xls | 995cfd273d5360947a528ff3a1ed3f9e52a429ad | [
"BSD-3-Clause"
] | 46 | 2016-02-01T22:12:31.000Z | 2021-10-07T18:57:05.000Z | pyexcel_xls/xlsw.py | wenxuefeng3930/pyexcel-xls | 995cfd273d5360947a528ff3a1ed3f9e52a429ad | [
"BSD-3-Clause"
] | 24 | 2016-01-29T12:26:27.000Z | 2021-10-31T15:37:15.000Z | """
pyexcel_xlsw
~~~~~~~~~~~~~~~~~~~
The lower level xls file format handler using xlwt
:copyright: (c) 2016-2021 by Onni Software Ltd
:license: New BSD License
"""
import datetime
import xlrd
from xlwt import XFStyle, Workbook
from pyexcel_io import constants
from pyexcel_io.plugin_api import IW... | 31.008929 | 78 | 0.589692 | import datetime
import xlrd
from xlwt import XFStyle, Workbook
from pyexcel_io import constants
from pyexcel_io.plugin_api import IWriter, ISheetWriter
DEFAULT_DATE_FORMAT = "DD/MM/YY"
DEFAULT_TIME_FORMAT = "HH:MM:SS"
DEFAULT_LONGTIME_FORMAT = "[HH]:MM:SS"
DEFAULT_DATETIME_FORMAT = "%s %s" % (DEFAULT_DATE_FORMAT, DEF... | true | true |
f70ec7201f8c108b954356e237165ff9018c482b | 3,781 | py | Python | ethgreen/wallet/wallet_interested_store.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 11 | 2021-11-10T19:30:12.000Z | 2022-02-09T04:30:29.000Z | ethgreen/wallet/wallet_interested_store.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 6 | 2021-11-16T17:11:03.000Z | 2021-12-28T17:11:20.000Z | ethgreen/wallet/wallet_interested_store.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 3 | 2021-11-21T02:27:10.000Z | 2022-03-15T08:34:47.000Z | from typing import List, Tuple, Optional
import aiosqlite
from ethgreen.types.blockchain_format.sized_bytes import bytes32
from ethgreen.util.db_wrapper import DBWrapper
class WalletInterestedStore:
"""
Stores coin ids that we are interested in receiving
"""
db_connection: aiosqlite.Connection
... | 37.81 | 115 | 0.649035 | from typing import List, Tuple, Optional
import aiosqlite
from ethgreen.types.blockchain_format.sized_bytes import bytes32
from ethgreen.util.db_wrapper import DBWrapper
class WalletInterestedStore:
db_connection: aiosqlite.Connection
db_wrapper: DBWrapper
@classmethod
async def create(cls, wrappe... | true | true |
f70ec721475523ddf5e94b147c1e716254668fe7 | 574 | py | Python | ui/maintenance_protocols/decompress.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 33 | 2017-03-12T16:26:45.000Z | 2021-04-30T05:37:35.000Z | ui/maintenance_protocols/decompress.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 6 | 2017-04-21T08:44:47.000Z | 2018-11-11T16:20:22.000Z | ui/maintenance_protocols/decompress.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 13 | 2017-03-12T16:26:56.000Z | 2020-04-20T05:35:00.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 14/01/2018 01:04 AM
# @Project : BioQueue
# @Author : Li Yao
# @File : gunzip.py
def get_sub_protocol(db_obj, protocol_parent, step_order_start=1):
steps = list()
steps.append(db_obj(software='gunzip',
parameter='{{InputFil... | 31.888889 | 66 | 0.560976 |
def get_sub_protocol(db_obj, protocol_parent, step_order_start=1):
steps = list()
steps.append(db_obj(software='gunzip',
parameter='{{InputFile}}',
parent=protocol_parent,
user_id=0,
hash='541df26aff8e4d054a5... | true | true |
f70ec72a7dd5c36e1338a62ba92bead14d1e8e76 | 846 | py | Python | altair_transform/transform/joinaggregate.py | jakevdp/altair-transform | 63094097e05891a8d12005b411ad8585b94e81fd | [
"MIT"
] | 38 | 2019-03-23T20:12:06.000Z | 2021-10-07T21:03:24.000Z | altair_transform/transform/joinaggregate.py | altair-viz/altair-transform | b65bf854de1e80f931e063d8fb2ec938773826fb | [
"MIT"
] | 13 | 2019-07-19T03:33:07.000Z | 2021-06-29T15:34:19.000Z | altair_transform/transform/joinaggregate.py | altair-viz/altair-transform | b65bf854de1e80f931e063d8fb2ec938773826fb | [
"MIT"
] | 11 | 2019-07-19T02:48:35.000Z | 2021-11-01T00:07:41.000Z | import altair as alt
import pandas as pd
from .visitor import visit
from .aggregate import AGG_REPLACEMENTS
@visit.register(alt.JoinAggregateTransform)
def visit_joinaggregate(
transform: alt.JoinAggregateTransform, df: pd.DataFrame
) -> pd.DataFrame:
transform = transform.to_dict()
groupby = transform.ge... | 29.172414 | 61 | 0.631206 | import altair as alt
import pandas as pd
from .visitor import visit
from .aggregate import AGG_REPLACEMENTS
@visit.register(alt.JoinAggregateTransform)
def visit_joinaggregate(
transform: alt.JoinAggregateTransform, df: pd.DataFrame
) -> pd.DataFrame:
transform = transform.to_dict()
groupby = transform.ge... | true | true |
f70ec8116b154a5c5324c8498dcdda97090753ab | 9,785 | py | Python | habitat/tasks/nav/object_nav_task.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | habitat/tasks/nav/object_nav_task.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | habitat/tasks/nav/object_nav_task.py | Ram81/habitat-imitation-baselines | c6e11c8ebadbf1260e1bed58a5b8dfb7faf6a505 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from typing import Any, List, Optional
import attr
from cv2 import log
import numpy as np
from gym import spaces
from habitat.config... | 33.62543 | 95 | 0.6465 |
import os
from typing import Any, List, Optional
import attr
from cv2 import log
import numpy as np
from gym import spaces
from habitat.config import Config
from habitat.core.dataset import SceneState
from habitat.core.logging import logger
from habitat.core.registry import registry
from habitat.core.simulator im... | true | true |
f70ec8b62d9552a0f4c485bf78d176b374cc936b | 8,312 | py | Python | kubernetes_asyncio/client/models/v2beta1_metric_spec.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v2beta1_metric_spec.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v2beta1_metric_spec.py | tomplus/kubernetes-asyncio | 11c3eb4d50ae822545572aa7b8c15f7153f65a1c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.23.6
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except Im... | 31.366038 | 302 | 0.617661 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V2beta1MetricSpec(object):
openapi_types = {
'container_resource': 'V2beta... | true | true |
f70ec900d5a3779330fc5069041b7d547061f02c | 765 | py | Python | backend/api/fields.py | NeutralDread/overworld | 0f608f83c10b666f2ed2cbe519186cf425a5e354 | [
"Apache-2.0"
] | null | null | null | backend/api/fields.py | NeutralDread/overworld | 0f608f83c10b666f2ed2cbe519186cf425a5e354 | [
"Apache-2.0"
] | null | null | null | backend/api/fields.py | NeutralDread/overworld | 0f608f83c10b666f2ed2cbe519186cf425a5e354 | [
"Apache-2.0"
] | null | null | null | _game_fields = [
'cover.image_id',
'first_release_date',
'genres.name',
'involved_companies.developer',
'involved_companies.publisher',
'involved_companies.company.country',
'involved_companies.company.name',
'name',
'platforms.name',
'screenshots.image_id',
'slug',
'summ... | 19.615385 | 44 | 0.648366 | _game_fields = [
'cover.image_id',
'first_release_date',
'genres.name',
'involved_companies.developer',
'involved_companies.publisher',
'involved_companies.company.country',
'involved_companies.company.name',
'name',
'platforms.name',
'screenshots.image_id',
'slug',
'summ... | true | true |
f70ec9f26a955802a506cc9f3c9095b2b09eb7e3 | 2,934 | py | Python | Ryu/topology.py | JoshuaYu-crash/C4EP2-2021 | 62e2e5a2fb396c598e7e8a265515c342fb78f63e | [
"MIT"
] | null | null | null | Ryu/topology.py | JoshuaYu-crash/C4EP2-2021 | 62e2e5a2fb396c598e7e8a265515c342fb78f63e | [
"MIT"
] | null | null | null | Ryu/topology.py | JoshuaYu-crash/C4EP2-2021 | 62e2e5a2fb396c598e7e8a265515c342fb78f63e | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, jsonify
from pyecharts import options as opts
from pyecharts.charts import Graph
import json
import redis
from flask_cors import *
r = redis.Redis(host="127.0.0.1", port=6379)
app = Flask(__name__)
CORS(app, supports_credentials=True)
@app.route("/dockermsg", method... | 33.340909 | 114 | 0.576005 | from flask import Flask, render_template, request, jsonify
from pyecharts import options as opts
from pyecharts.charts import Graph
import json
import redis
from flask_cors import *
r = redis.Redis(host="127.0.0.1", port=6379)
app = Flask(__name__)
CORS(app, supports_credentials=True)
@app.route("/dockermsg", method... | true | true |
f70eca4f5372f1f42a5b19b9379ac5026d17bfca | 829 | py | Python | app/core/migrations/0010_requestlogs.py | shravands/django-restapi-recipe | c21d01ab3b0d92d249e638a1b503ea54dd6d69bd | [
"MIT"
] | null | null | null | app/core/migrations/0010_requestlogs.py | shravands/django-restapi-recipe | c21d01ab3b0d92d249e638a1b503ea54dd6d69bd | [
"MIT"
] | null | null | null | app/core/migrations/0010_requestlogs.py | shravands/django-restapi-recipe | c21d01ab3b0d92d249e638a1b503ea54dd6d69bd | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-06-09 08:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_user_username'),
]
operations = [
migrations.CreateModel(
name='RequestLogs',
fields=[
... | 33.16 | 114 | 0.589867 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0009_user_username'),
]
operations = [
migrations.CreateModel(
name='RequestLogs',
fields=[
('id', models.AutoField(auto_created=True, prim... | true | true |
f70ecb6c0cf51dc2a65ebc399f0d6b7793c3420a | 5,755 | py | Python | dumper.py | juliuswwj/wchprog | 8cab50d60fb224a4a526d3cbddc5512a7a315c0c | [
"Unlicense"
] | 24 | 2018-02-05T08:18:04.000Z | 2021-06-09T07:48:18.000Z | dumper.py | juliuswwj/wchprog | 8cab50d60fb224a4a526d3cbddc5512a7a315c0c | [
"Unlicense"
] | null | null | null | dumper.py | juliuswwj/wchprog | 8cab50d60fb224a4a526d3cbddc5512a7a315c0c | [
"Unlicense"
] | 4 | 2018-10-22T11:51:47.000Z | 2022-01-03T18:31:17.000Z | #!/usr/bin/python
from __future__ import print_function
import struct
import sys
import usb.core
import usb.util
from intelhex import IntelHex
scrambleCode = (0x29, 0x52, 0x8C, 0x70)
stats = [0xff, 0x02, 0x00, 0xf5, 0xe5, 0x75, 0x03, 0x04,
0x80, 0x05, 0xd2, 0x01, 0xe4, 0xef, 0x82, 0x83,
0x08, 0x24,... | 36.194969 | 150 | 0.541095 |
from __future__ import print_function
import struct
import sys
import usb.core
import usb.util
from intelhex import IntelHex
scrambleCode = (0x29, 0x52, 0x8C, 0x70)
stats = [0xff, 0x02, 0x00, 0xf5, 0xe5, 0x75, 0x03, 0x04,
0x80, 0x05, 0xd2, 0x01, 0xe4, 0xef, 0x82, 0x83,
0x08, 0x24, 0xc2, 0x60, 0xe0... | true | true |
f70eccdf3d70966d6d64d44596755eb21c6d962f | 2,833 | py | Python | plugins/Limiter/test.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 40 | 2015-01-28T22:16:36.000Z | 2021-12-15T02:22:56.000Z | plugins/Limiter/test.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | plugins/Limiter/test.py | jlu5/Limnoria | 0e1e37a5a2bd5b717e11320b20773644b44502dd | [
"BSD-3-Clause"
] | 28 | 2015-01-03T23:53:58.000Z | 2021-06-01T05:27:20.000Z | ###
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | 49.701754 | 79 | 0.715849 |
rom supybot.test import *
class LimiterTestCase(ChannelPluginTestCase):
plugins = ('Limiter',)
config = {'supybot.plugins.Limiter.enable': True}
def testEnforceLimit(self):
origMin = conf.supybot.plugins.Limiter.minimumExcess()
origMax = conf.supybot.plugins.Limiter.... | true | true |
f70ecd4ecdb9ab2866986a996b957e57d611e42c | 1,547 | py | Python | aiostripe/http_client.py | cypreess/aiostripe | 8453a377b95373192c2e1598b9a951e8437d2bc9 | [
"MIT"
] | null | null | null | aiostripe/http_client.py | cypreess/aiostripe | 8453a377b95373192c2e1598b9a951e8437d2bc9 | [
"MIT"
] | 1 | 2018-08-18T16:14:50.000Z | 2018-08-18T16:14:50.000Z | aiostripe/http_client.py | cypreess/aiostripe | 8453a377b95373192c2e1598b9a951e8437d2bc9 | [
"MIT"
] | null | null | null | import textwrap
import aiohttp
from aiostripe import error
def new_default_http_client(*args, **kwargs):
return AsyncioClient(*args, **kwargs)
class HTTPClient(object):
def __init__(self, verify_ssl_certs=True):
self._verify_ssl_certs = verify_ssl_certs
def request(self, method, url, headers,... | 32.914894 | 112 | 0.625081 | import textwrap
import aiohttp
from aiostripe import error
def new_default_http_client(*args, **kwargs):
return AsyncioClient(*args, **kwargs)
class HTTPClient(object):
def __init__(self, verify_ssl_certs=True):
self._verify_ssl_certs = verify_ssl_certs
def request(self, method, url, headers,... | true | true |
f70ecd852b59e53b25f1ade391a6eaf6cb8f5d9e | 9,513 | py | Python | config/settings/base.py | JuvasArray/algerian-library | 3e19fe23799198b0e0218148a692bcdd5df812b7 | [
"MIT"
] | null | null | null | config/settings/base.py | JuvasArray/algerian-library | 3e19fe23799198b0e0218148a692bcdd5df812b7 | [
"MIT"
] | null | null | null | config/settings/base.py | JuvasArray/algerian-library | 3e19fe23799198b0e0218148a692bcdd5df812b7 | [
"MIT"
] | null | null | null | """
Base settings to build other settings files upon.
"""
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (algerian_library/config/settings/base.py - 3 = algerian_library/)
APPS_DIR = ROOT_DIR.path('algerian_library')
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False... | 39.473029 | 107 | 0.63019 |
import environ
ROOT_DIR = environ.Path(__file__) - 3
APPS_DIR = ROOT_DIR.path('algerian_library')
env = environ.Env()
READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False)
if READ_DOT_ENV_FILE:
env.read_env(str(ROOT_DIR.path('.env')))
= env.bool('DJANGO_DEBUG', False)
TIME_ZONE ... | true | true |
f70ece528875d32f06dc3c54bf04e158f1a2d255 | 1,041 | py | Python | Colloquiums/2015-2016/Colloquium_2/Exercise_3.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 7 | 2021-12-28T23:38:42.000Z | 2022-03-29T16:36:16.000Z | Colloquiums/2015-2016/Colloquium_2/Exercise_3.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | null | null | null | Colloquiums/2015-2016/Colloquium_2/Exercise_3.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 4 | 2021-06-29T20:21:52.000Z | 2022-03-12T10:04:17.000Z | # Zbiór przedziałów [(a[1], b[1]), ..., (a[n], b[n])], każdy przedział należy do [0, 1]. Opisać algorytm
# który sprawdzi czy jest możliwy taki wybór przedziałów, aby cały przedział [0, 1] zawierał się
# w wybranych odcinkach. Przedział ma składać się z jak najmniejszej ilości odcinków.
def minimum_intervals(T):
... | 33.580645 | 104 | 0.511047 |
def minimum_intervals(T):
T.sort(key=lambda x: x[0])
i = 0
end = 0
result = []
while i < len(T) and end != 1:
actual_start = T[i][0]
actual_end = T[i][1]
flag = True
while i != len(T) and T[i][0] <= end:
if actual_end < T[i][1]:
actual... | true | true |
f70ecf74f79d361841d4e6df6243e83e7cf59479 | 3,423 | py | Python | fuelweb_test/tests/tests_strength/test_master_node_failover.py | Fiware/ops.Fuel-main-dev | 779ffdcc9630d780777c60270fdc2f8baf87750a | [
"Apache-2.0"
] | null | null | null | fuelweb_test/tests/tests_strength/test_master_node_failover.py | Fiware/ops.Fuel-main-dev | 779ffdcc9630d780777c60270fdc2f8baf87750a | [
"Apache-2.0"
] | null | null | null | fuelweb_test/tests/tests_strength/test_master_node_failover.py | Fiware/ops.Fuel-main-dev | 779ffdcc9630d780777c60270fdc2f8baf87750a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 35.28866 | 79 | 0.665498 |
from proboscis.asserts import assert_equal
from proboscis import test
from fuelweb_test.helpers import common
from fuelweb_test.helpers import os_actions
from fuelweb_test import settings
from fuelweb_test import logger
from fuelweb_test.tests import base_test_case
@test(groups=["thread_non_func_1"])
c... | true | true |
f70ed06f593fd1a20fc7b1ab5ee37ec4ed1cbc04 | 6,980 | py | Python | denonavr/denon_receiver_xml.py | scarface-4711/misc_python_tools | 66ce06f2f77d2e49bdbac7fd11e6fa7cbb6e56c9 | [
"MIT"
] | null | null | null | denonavr/denon_receiver_xml.py | scarface-4711/misc_python_tools | 66ce06f2f77d2e49bdbac7fd11e6fa7cbb6e56c9 | [
"MIT"
] | null | null | null | denonavr/denon_receiver_xml.py | scarface-4711/misc_python_tools | 66ce06f2f77d2e49bdbac7fd11e6fa7cbb6e56c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This python program saves test XMLs from denon receiver to current directory.
Usage: python denon_receiver_xml.py --host 192.168.0.250 --prefix AVR-X4100W
:copyright: (c) 2017 by Oliver Goetz.
:license: MIT, see LICENSE for more details.
"""
import argparse
from io im... | 40.581395 | 78 | 0.557593 |
import argparse
from io import BytesIO
import requests
import xml.etree.ElementTree as ET
from collections import namedtuple
XML = namedtuple("XML", ["port", "type", "path", "tags", "filename"])
SAVED_XML = [XML("80", "post", "/goform/AppCommand.xml",
["GetFriendlyName"],
"AppComma... | true | true |
f70ed079519d07f15d65e53bdf79fb821a1b32ee | 572 | py | Python | pajbot/models/roulette.py | sadlyfell/bullbot | b6ef96f61678fab4a245d8ccddf9d1ae7aae9fee | [
"MIT"
] | null | null | null | pajbot/models/roulette.py | sadlyfell/bullbot | b6ef96f61678fab4a245d8ccddf9d1ae7aae9fee | [
"MIT"
] | null | null | null | pajbot/models/roulette.py | sadlyfell/bullbot | b6ef96f61678fab4a245d8ccddf9d1ae7aae9fee | [
"MIT"
] | null | null | null | import logging
from sqlalchemy import Column, INT
from sqlalchemy_utc import UtcDateTime
from pajbot import utils
from pajbot.managers.db import Base
log = logging.getLogger(__name__)
class Roulette(Base):
__tablename__ = "roulette"
id = Column(INT, primary_key=True)
user_id = Column(INT, index=True, ... | 23.833333 | 54 | 0.715035 | import logging
from sqlalchemy import Column, INT
from sqlalchemy_utc import UtcDateTime
from pajbot import utils
from pajbot.managers.db import Base
log = logging.getLogger(__name__)
class Roulette(Base):
__tablename__ = "roulette"
id = Column(INT, primary_key=True)
user_id = Column(INT, index=True, ... | true | true |
f70ed2aba5dd366ab069ddd450e6381cb10d7545 | 1,620 | py | Python | course1/fibonacci.py | ropable/algorithmic_toolbox | b4dcf4fda19c394da2baa6eced0732bf50585237 | [
"MIT"
] | 1 | 2017-11-21T08:08:55.000Z | 2017-11-21T08:08:55.000Z | course1/fibonacci.py | ropable/algorithmic_toolbox | b4dcf4fda19c394da2baa6eced0732bf50585237 | [
"MIT"
] | null | null | null | course1/fibonacci.py | ropable/algorithmic_toolbox | b4dcf4fda19c394da2baa6eced0732bf50585237 | [
"MIT"
] | null | null | null | # python3
import sys
def fib_slow(n):
'''Dumb (slow) example solution.
'''
if (n <= 1):
return n
return fib_slow(n - 1) + fib_slow(n - 2)
def fib_countup(n):
'''Less-dumb 'count up as you go' solution.
'''
if (n <= 1):
return n
x, y = 0, 1
for i in range(n):
... | 21.315789 | 68 | 0.5 |
import sys
def fib_slow(n):
if (n <= 1):
return n
return fib_slow(n - 1) + fib_slow(n - 2)
def fib_countup(n):
if (n <= 1):
return n
x, y = 0, 1
for i in range(n):
x, y = y, x + y
return x
def fib_memoize(n, saved={0: 0, 1: 1}):
if (n <= 1):
return n
... | true | true |
f70ed379460fc7865b9be45f22f1afeb631c5ba3 | 4,077 | py | Python | stream_alert/rule_processor/config.py | serhatcan/streamalert | 0549bb05163b7b54c30365312948caa21e44be98 | [
"Apache-2.0"
] | 1 | 2020-03-10T16:20:31.000Z | 2020-03-10T16:20:31.000Z | stream_alert/rule_processor/config.py | serhatcan/streamalert | 0549bb05163b7b54c30365312948caa21e44be98 | [
"Apache-2.0"
] | null | null | null | stream_alert/rule_processor/config.py | serhatcan/streamalert | 0549bb05163b7b54c30365312948caa21e44be98 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 36.079646 | 89 | 0.646063 |
import json
import os
from collections import OrderedDict
class ConfigError(Exception):
pass
def load_config(conf_dir='conf/'):
conf_files = {
'sources': 'sources.json',
'logs': 'logs.json'
}
config = {}
for desc, filename in conf_files.iteritems():
with open(os.path.join... | true | true |
f70ed39ecc8bdbd9e8238a2309e2bc5cdca95fb6 | 5,838 | py | Python | openstack_dashboard/test/integration_tests/helpers.py | izadorozhna/dashboard_integration_tests | c1ee45b98832cf3a4bb01aa37410afc3a96fd2a3 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/integration_tests/helpers.py | izadorozhna/dashboard_integration_tests | c1ee45b98832cf3a4bb01aa37410afc3a96fd2a3 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/integration_tests/helpers.py | izadorozhna/dashboard_integration_tests | c1ee45b98832cf3a4bb01aa37410afc3a96fd2a3 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 36.4875 | 86 | 0.658787 |
import datetime
import os
import sys
import time
import traceback
import uuid
import testtools
import xvfbwrapper
from openstack_dashboard.test.integration_tests import config
from openstack_dashboard.test.integration_tests.pages import loginpage
from openstack_dashboard.test.integration_tests import webd... | true | true |
f70ed42cc612bcaad5c20d49c4025518f3b003ee | 753 | py | Python | issues/migrations/0006_auto_20200501_0352.py | QizaiMing/ergo-project-manager | 2b02b2ab6d9e48bfccbbca8c05180b07177dcb77 | [
"MIT"
] | null | null | null | issues/migrations/0006_auto_20200501_0352.py | QizaiMing/ergo-project-manager | 2b02b2ab6d9e48bfccbbca8c05180b07177dcb77 | [
"MIT"
] | 3 | 2020-11-01T22:08:38.000Z | 2022-03-12T00:49:00.000Z | issues/migrations/0006_auto_20200501_0352.py | QizaiMing/ergo-project-manager | 2b02b2ab6d9e48bfccbbca8c05180b07177dcb77 | [
"MIT"
] | 2 | 2021-01-03T07:17:16.000Z | 2021-05-29T17:27:11.000Z | # Generated by Django 2.2.12 on 2020-05-01 03:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '0005_auto_20200501_0350'),
]
operations = [
migrations.AlterFie... | 28.961538 | 138 | 0.648074 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '0005_auto_20200501_0350'),
]
operations = [
migrations.AlterField(
model_name='issue',
... | true | true |
f70ed45272dbd6f48258226d6075604286c262fa | 1,308 | py | Python | tests/test_xml_bibs.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | null | null | null | tests/test_xml_bibs.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | 58 | 2017-10-16T13:09:33.000Z | 2022-01-10T15:35:58.000Z | tests/test_xml_bibs.py | Mfgloger/overload | b34f88750d9272db268324807f7e8ba308940d1e | [
"MIT"
] | 2 | 2019-04-15T16:04:38.000Z | 2020-11-03T17:58:33.000Z | # -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import unittest
from context import xml_bibs as xb
class TestGetSubjectFields(unittest.TestCase):
"""Tests parsing of subjects from marcxml"""
def setUp(self):
tree = ET.parse("sample_marcxml.xml")
self.data1 = tree.getroot()
... | 25.153846 | 84 | 0.666667 |
import xml.etree.ElementTree as ET
import unittest
from context import xml_bibs as xb
class TestGetSubjectFields(unittest.TestCase):
def setUp(self):
tree = ET.parse("sample_marcxml.xml")
self.data1 = tree.getroot()
tree = ET.parse("missing_tags_sample_marcxml.xml")
self.data... | true | true |
f70ed4a6ff4da8d2043098a40b6f32d51fb96cb8 | 8,719 | py | Python | run_preprocessing.py | ehwa009/Eye_Motion_Dataset | 42a1c897dc4209c6bb2de94c915ab36995855202 | [
"MIT"
] | null | null | null | run_preprocessing.py | ehwa009/Eye_Motion_Dataset | 42a1c897dc4209c6bb2de94c915ab36995855202 | [
"MIT"
] | null | null | null | run_preprocessing.py | ehwa009/Eye_Motion_Dataset | 42a1c897dc4209c6bb2de94c915ab36995855202 | [
"MIT"
] | 1 | 2020-03-11T02:14:14.000Z | 2020-03-11T02:14:14.000Z | import pickle
import argparse
import pandas as pd
import numpy as np
import math
from tqdm import tqdm
from sklearn import decomposition
CENTER_X = int(960 / 3 / 2)
CENTER_Y = int(540 / 3 / 2)
# CENTER_X = 0
# CENTER_Y = 0
def load_data(path, data_size=None):
with open(path, 'rb') as f:
data = pickle.l... | 40.553488 | 141 | 0.592384 | import pickle
import argparse
import pandas as pd
import numpy as np
import math
from tqdm import tqdm
from sklearn import decomposition
CENTER_X = int(960 / 3 / 2)
CENTER_Y = int(540 / 3 / 2)
def load_data(path, data_size=None):
with open(path, 'rb') as f:
data = pickle.load(f)
if data_size != -... | true | true |
f70ed57a100157333fff98601e50b3e635feeceb | 1,144 | py | Python | summarize_clstr_table.py | FischbachLab/hCom_variable_regions | 6f1108c461a7e31964d1d81a83c03b9f4dad4c76 | [
"MIT"
] | null | null | null | summarize_clstr_table.py | FischbachLab/hCom_variable_regions | 6f1108c461a7e31964d1d81a83c03b9f4dad4c76 | [
"MIT"
] | null | null | null | summarize_clstr_table.py | FischbachLab/hCom_variable_regions | 6f1108c461a7e31964d1d81a83c03b9f4dad4c76 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
## How many clusters have more than one organisms as it's members
import sys
import pandas as pd
import logging
def main():
clstr_table = sys.argv[1]
output = sys.argv[2]
clstr_df = pd.read_table(clstr_table, header=0)
clstr_df["organism"] = clstr_df["id"].apply(lambda x: x.spl... | 28.6 | 129 | 0.664336 |
clstr_table = sys.argv[1]
output = sys.argv[2]
clstr_df = pd.read_table(clstr_table, header=0)
clstr_df["organism"] = clstr_df["id"].apply(lambda x: x.split(":")[2].split("_")[0])
summ_df = clstr_df.groupby("clstr").agg(
num_organisms=("organism", pd.Series.nunique), organism_list=("organism... | true | true |
f70ed5fc8d9dec798cc962a5f3c011a61fe76693 | 2,444 | py | Python | scraper/views.py | ziibii88/The_Doe_Agency | 2545aeae71c779166bef78941cac36551498ca76 | [
"MIT"
] | 2 | 2021-07-16T10:25:15.000Z | 2021-08-07T04:44:08.000Z | scraper/views.py | ziibii88/The_Doe_Agency | 2545aeae71c779166bef78941cac36551498ca76 | [
"MIT"
] | null | null | null | scraper/views.py | ziibii88/The_Doe_Agency | 2545aeae71c779166bef78941cac36551498ca76 | [
"MIT"
] | null | null | null | from http import HTTPStatus
from rest_framework import views, viewsets
from rest_framework.exceptions import ParseError
from rest_framework.request import Request
from rest_framework.response import Response
from scraper import models, serializers, tasks
from scraper.utils import get_random_working_proxy
class Webs... | 33.944444 | 77 | 0.673486 | from http import HTTPStatus
from rest_framework import views, viewsets
from rest_framework.exceptions import ParseError
from rest_framework.request import Request
from rest_framework.response import Response
from scraper import models, serializers, tasks
from scraper.utils import get_random_working_proxy
class Webs... | true | true |
f70ed613214d53ae4a2ef2bfdd73ff060ad133c9 | 1,723 | py | Python | rainforest/resources/generator.py | apibitsco/rainforestapp-python | 426245fdb93748d4c2a6f3f12bcce3af20320137 | [
"MIT"
] | 1 | 2016-10-25T18:47:55.000Z | 2016-10-25T18:47:55.000Z | rainforest/resources/generator.py | apibitsco/rainforestapp-python | 426245fdb93748d4c2a6f3f12bcce3af20320137 | [
"MIT"
] | 6 | 2015-10-15T11:27:42.000Z | 2019-01-31T10:12:42.000Z | rainforest/resources/generator.py | rainforestapp/rainforest-python | c0e5c5dba55c000ee6f92ae5fc9db5f90e415500 | [
"MIT"
] | null | null | null | from ..apibits import *
from ..endpoints import GeneratorsEndpoint
from ..endpoints import GeneratorRowsEndpoint
class Generator(ApiResource):
@classmethod
def all(cls, params={}, headers={}):
res = cls.default_client().generators().all(params, headers)
return res
@classmethod
def ret... | 31.907407 | 87 | 0.623331 | from ..apibits import *
from ..endpoints import GeneratorsEndpoint
from ..endpoints import GeneratorRowsEndpoint
class Generator(ApiResource):
@classmethod
def all(cls, params={}, headers={}):
res = cls.default_client().generators().all(params, headers)
return res
@classmethod
def ret... | true | true |
f70ed6226b4c9cac885acb0f851cfe76cf8b5c36 | 2,526 | py | Python | plugins/Relay/__init__.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 476 | 2015-01-04T17:42:59.000Z | 2021-08-13T07:40:54.000Z | plugins/Relay/__init__.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 491 | 2015-01-01T04:12:23.000Z | 2021-08-12T19:24:47.000Z | plugins/Relay/__init__.py | mogad0n/Limnoria | f31e5c4b9a77e30918d6b93f69d69f3b8f910e3c | [
"BSD-3-Clause"
] | 203 | 2015-01-02T18:29:43.000Z | 2021-08-15T12:52:22.000Z | ###
# Copyright (c) 2005, Jeremiah Fincher
# Copyright (c) 2010-2021, The Limnoria Contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain t... | 39.46875 | 79 | 0.770388 |
import supybot
import supybot.world as world
__version__ = "%%VERSION%%"
__author__ = supybot.authors.jemfinch
__maintainer__ = supybot.authors.limnoria_core
# This is a dictionary mapping supybot.Author instances to lists of
# contributions.
__contributors__ = {}
from . import config
fro... | true | true |
f70ed72ef52e88cf5e169ee95f60603d4184a74c | 10,110 | py | Python | jina/__init__.py | DeepikaGupta09/jina | 2fc328d10f2fbc79d943064a90dd3170cb83f979 | [
"Apache-2.0"
] | 1 | 2021-01-30T11:59:27.000Z | 2021-01-30T11:59:27.000Z | jina/__init__.py | DeepikaGupta09/jina | 2fc328d10f2fbc79d943064a90dd3170cb83f979 | [
"Apache-2.0"
] | null | null | null | jina/__init__.py | DeepikaGupta09/jina | 2fc328d10f2fbc79d943064a90dd3170cb83f979 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
# do not change this line manually
# this is managed by git tag and updated on every release
__version__ = '0.6.8'
# do not change this line manually
# this is managed by proto/build-proto.sh and updated on every exe... | 37.583643 | 123 | 0.608902 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
__version__ = '0.6.8'
__proto_version__ = '0.0.65'
import platform
import sys
if sys.version_info < (3, 7, 0):
raise OSError('Jina requires Python 3.7 and above, but yours is %s' % sys.version_info)
if s... | true | true |
f70ed7a3904e97fcc423d33699a21383a00fac2d | 1,141 | py | Python | starthinker/task/dcm_api/schema/contentCategory.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/task/dcm_api/schema/contentCategory.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/task/dcm_api/schema/contentCategory.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"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
#
# https://www.apache.org/l... | 28.525 | 75 | 0.548642 | true | true | |
f70ed86c28d0cafaa9d770eaabf664fc7e463062 | 24,589 | py | Python | federatedml/ftl/hetero_ftl/hetero_ftl_host.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | 1 | 2019-07-29T13:22:36.000Z | 2019-07-29T13:22:36.000Z | federatedml/ftl/hetero_ftl/hetero_ftl_host.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | null | null | null | federatedml/ftl/hetero_ftl/hetero_ftl_host.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 52.87957 | 163 | 0.65086 |
import time
import numpy as np
from arch.api.utils import log_utils
from federatedml.evaluation import Evaluation
from federatedml.ftl.data_util.common_data_util import overlapping_samples_converter, load_model_parameters, \
save_model_parameters, create_table, convert_instance_table_to_dict, conv... | true | true |
f70ed94f13b9a9e2b5858fd0c87188c4b200f45e | 12,025 | py | Python | h5pyViewer/FrmPyFAI.py | warlock8hz/h5pyViewer | 4955aa6fdd66255738bd86d7b8947282133c5b82 | [
"BSD-2-Clause"
] | null | null | null | h5pyViewer/FrmPyFAI.py | warlock8hz/h5pyViewer | 4955aa6fdd66255738bd86d7b8947282133c5b82 | [
"BSD-2-Clause"
] | null | null | null | h5pyViewer/FrmPyFAI.py | warlock8hz/h5pyViewer | 4955aa6fdd66255738bd86d7b8947282133c5b82 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#*-----------------------------------------------------------------------*
#| |
#| Copyright (c) 2013 by Paul Scherrer Institute (http://www.psi.ch) |
#| ... | 33.495822 | 139 | 0.66079 |
if __name__ == '__main__':
import wxversion
wxversion.ensureMinimal('2.8')
import wx
import matplotlib as mpl
if __name__ == '__main__':
mpl.use('WXAgg')
import os,h5py
import numpy as np
import utilities as ut
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
impor... | true | true |
f70eda35866cba2084e688dbeedbd967c56a9f44 | 548 | py | Python | my_agents/evaluate.py | ramirezalbert3/my_agents | fd8ffc8c2f157292b4d309ab1899326007aea726 | [
"MIT"
] | null | null | null | my_agents/evaluate.py | ramirezalbert3/my_agents | fd8ffc8c2f157292b4d309ab1899326007aea726 | [
"MIT"
] | null | null | null | my_agents/evaluate.py | ramirezalbert3/my_agents | fd8ffc8c2f157292b4d309ab1899326007aea726 | [
"MIT"
] | null | null | null | import gym
from gym import logger
from core.states import StateSerializer
from core.runner import Runner
from agents.dqn_agent import DQNAgent
logger.set_level(logger.INFO)
env_name = 'CartPole-v0'
env = gym.make(env_name)
env._max_episode_steps = 500
serializer = StateSerializer(env.observation_space.shape)
agent ... | 22.833333 | 57 | 0.751825 | import gym
from gym import logger
from core.states import StateSerializer
from core.runner import Runner
from agents.dqn_agent import DQNAgent
logger.set_level(logger.INFO)
env_name = 'CartPole-v0'
env = gym.make(env_name)
env._max_episode_steps = 500
serializer = StateSerializer(env.observation_space.shape)
agent ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.