hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abee910521a942c87b17be2990f3cac2a8315d61 | 4,060 | py | Python | example/NaCl/NaCl.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 127 | 2015-01-21T17:50:58.000Z | 2020-02-04T13:46:13.000Z | example/NaCl/NaCl.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 100 | 2015-02-07T15:32:50.000Z | 2020-02-23T02:09:08.000Z | example/NaCl/NaCl.py | ladyteam/phonopy | 455ef61dfa15c01fb6b516461b52f15aefbf92b3 | [
"BSD-3-Clause"
] | 122 | 2015-02-07T15:39:28.000Z | 2020-02-10T22:33:16.000Z | """Example of NaCl calculation."""
from typing import List
import numpy as np
from phonopy import Phonopy
from phonopy.file_IO import parse_BORN, parse_FORCE_SETS
from phonopy.interface.vasp import read_vasp
# from phonopy.structure.atoms import PhonopyAtoms
def _append_band(bands, q_start, q_end):
band = []
... | 34.40678 | 87 | 0.593103 |
44b0333c707c802962567c576c0055655c5b498e | 7,286 | py | Python | tools/RAiDER/checkArgs.py | jlmaurer/RAiDER-1 | 76aeeaf5275016bc5e2b1a4fd9fc21c6e65add2d | [
"Apache-2.0"
] | 1 | 2021-08-17T13:28:28.000Z | 2021-08-17T13:28:28.000Z | tools/RAiDER/checkArgs.py | jlmaurer/RAiDER-1 | 76aeeaf5275016bc5e2b1a4fd9fc21c6e65add2d | [
"Apache-2.0"
] | 3 | 2020-07-21T05:12:30.000Z | 2020-09-03T03:30:13.000Z | tools/RAiDER/checkArgs.py | jlmaurer/RAiDER-1 | 76aeeaf5275016bc5e2b1a4fd9fc21c6e65add2d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Author: Jeremy Maurer, Raymond Hogenson & David Bekaert
# Copyright 2019, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged.
#
# ~~~~~~~~~~~~~~~~~... | 32.382222 | 158 | 0.598408 |
0920f346f8cbfaeea2cda4666a682813b0525439 | 2,377 | py | Python | starfish/pipeline/gene_assignment/__init__.py | Xiaojieqiu/starfish | 426480fcfeda4b8b1eb9371a818ff20275ac898d | [
"MIT"
] | 1 | 2018-10-07T03:53:43.000Z | 2018-10-07T03:53:43.000Z | starfish/pipeline/gene_assignment/__init__.py | Xiaojieqiu/starfish | 426480fcfeda4b8b1eb9371a818ff20275ac898d | [
"MIT"
] | null | null | null | starfish/pipeline/gene_assignment/__init__.py | Xiaojieqiu/starfish | 426480fcfeda4b8b1eb9371a818ff20275ac898d | [
"MIT"
] | null | null | null | import argparse
import json
from starfish.pipeline.pipelinecomponent import PipelineComponent
from starfish.util.argparse import FsExistsType
from starfish.intensity_table import IntensityTable
from . import _base
from . import point_in_poly
class GeneAssignment(PipelineComponent):
gene_assignment_group: argpar... | 40.982759 | 113 | 0.741271 |
a57016533245a09f7c500252e5441023e5d5b5df | 1,639 | tac | Python | vendor/Twisted-10.0.0/doc/mail/tutorial/smtpclient/smtpclient-11.tac | bopopescu/cc-2 | 37444fb16b36743c439b0d6c3cac2347e0cc0a94 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | vendor/Twisted-10.0.0/doc/mail/tutorial/smtpclient/smtpclient-11.tac | bopopescu/cc-2 | 37444fb16b36743c439b0d6c3cac2347e0cc0a94 | [
"Apache-2.0"
] | 1 | 2020-08-02T15:40:49.000Z | 2020-08-02T15:40:49.000Z | vendor/Twisted-10.0.0/doc/mail/tutorial/smtpclient/smtpclient-11.tac | bopopescu/cc-2 | 37444fb16b36743c439b0d6c3cac2347e0cc0a94 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | import StringIO
from twisted.application import service
application = service.Application("SMTP Client Tutorial")
from twisted.application import internet
from twisted.internet import protocol
from twisted.internet import defer
from twisted.mail import smtp, relaymanager
class SMTPTutorialClient(smtp.ESMTPClient):
... | 27.779661 | 75 | 0.737645 |
99940967eb19f550e4da677d4c92229f67f6af75 | 2,706 | py | Python | ethpm/_utils/chains.py | ajrgrubbs/web3.py | a679ff58fc349fba3f5660c1dd938da62c07e86c | [
"MIT"
] | null | null | null | ethpm/_utils/chains.py | ajrgrubbs/web3.py | a679ff58fc349fba3f5660c1dd938da62c07e86c | [
"MIT"
] | null | null | null | ethpm/_utils/chains.py | ajrgrubbs/web3.py | a679ff58fc349fba3f5660c1dd938da62c07e86c | [
"MIT"
] | null | null | null | import re
from typing import (
Any,
Tuple,
)
from urllib import (
parse,
)
from eth_typing import (
URI,
BlockNumber,
HexStr,
)
from eth_utils import (
add_0x_prefix,
is_integer,
remove_0x_prefix,
)
from ethpm.constants import (
SUPPORTED_CHAIN_IDS,
)
from web3 import Web3
de... | 24.6 | 97 | 0.658167 |
9840447347b80f30f4fc355d544bb1bd6f5afc52 | 176 | py | Python | CS208/exercise1/nf.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS208/exercise1/nf.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS208/exercise1/nf.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import random
def work(n):
if n == 0:
return
for i in range(n):
a = random.uniform(0, 1)
work(i - 1)
if __name__ == "__main__":
work(10)
| 13.538462 | 32 | 0.5 |
bf0a7424adcab272a09a7789874f2472f1bac23e | 3,763 | py | Python | lib/libauthz.py | cloudxaas/cloudauth | 4c199f992356d8231da0627b33a4e833ed059ac4 | [
"Apache-2.0"
] | null | null | null | lib/libauthz.py | cloudxaas/cloudauth | 4c199f992356d8231da0627b33a4e833ed059ac4 | [
"Apache-2.0"
] | null | null | null | lib/libauthz.py | cloudxaas/cloudauth | 4c199f992356d8231da0627b33a4e833ed059ac4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import sys
import pwd
import uuid
import struct
import socket
import logging
import base64
import urlparse
import time
import datetime
import json
import grp, pwd
import libauthn
from M2Crypto import EVP, EC, util
logger = logging.getLogger("libauthz")
def assert_authz(qstr, authn_cer... | 22.668675 | 105 | 0.593144 |
c3d2a4e37ad065d0f86537c2d40aefbe41dbcc73 | 3,776 | py | Python | examples/addresses/update_address_attributes.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 10 | 2016-10-17T07:14:05.000Z | 2021-12-05T02:54:41.000Z | examples/addresses/update_address_attributes.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 14 | 2017-02-26T23:52:00.000Z | 2017-09-16T19:28:49.000Z | examples/addresses/update_address_attributes.py | route4me/route4me-python-sdk | e2136c54e1ec5ed518f8eb94d5883486e0ec3afd | [
"0BSD"
] | 8 | 2017-02-23T14:27:07.000Z | 2020-05-23T14:23:55.000Z | # -*- coding: utf-8 -*-
from route4me import Route4Me
from route4me.constants import (
ALGORITHM_TYPE,
OPTIMIZE,
DISTANCE_UNIT,
DEVICE_TYPE,
TRAVEL_MODE
)
API_KEY = "11111111111111111111111111111111"
# codebeat:disable[LOC, ABC]
def main():
r4m = Route4Me(API_KEY)
optimization = r4m.op... | 29.5 | 83 | 0.580244 |
97ed17be538b517500b1ebef5c09741edc139e35 | 930 | py | Python | sagify/__main__.py | MattiaU/sagify | b9715eef0f146b5c07da21d81cc88e06a0721350 | [
"MIT"
] | null | null | null | sagify/__main__.py | MattiaU/sagify | b9715eef0f146b5c07da21d81cc88e06a0721350 | [
"MIT"
] | null | null | null | sagify/__main__.py | MattiaU/sagify | b9715eef0f146b5c07da21d81cc88e06a0721350 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import click
from sagify.commands.build import build
from sagify.commands.cloud import cloud
from sagify.commands.initialize import init
from sagify.commands.local import local
from sagify.commands.push import push
from sagify.log import configure_logger
... | 26.571429 | 100 | 0.741935 |
32cf1d2d3796bea8000ed319af5a70bd3f861b32 | 108 | py | Python | Classes/Base.py | eddo888/ClassyData | 93f443d9a846c1e5c3ed58d0bf02603162a406d1 | [
"MIT"
] | null | null | null | Classes/Base.py | eddo888/ClassyData | 93f443d9a846c1e5c3ed58d0bf02603162a406d1 | [
"MIT"
] | null | null | null | Classes/Base.py | eddo888/ClassyData | 93f443d9a846c1e5c3ed58d0bf02603162a406d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
| 15.428571 | 55 | 0.796296 |
ba799ec3edf3598733976fe34e641d87248a3bc5 | 677 | py | Python | examples/plotting/server/twin_axis.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 2 | 2021-09-01T12:36:06.000Z | 2021-11-17T10:48:36.000Z | examples/plotting/server/twin_axis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | examples/plotting/server/twin_axis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | 1 | 2021-08-01T08:38:53.000Z | 2021-08-01T08:38:53.000Z | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from __future__ import print_function
from numpy import pi, arange, sin, linspace
from bokeh.plotting import *
from bokeh.models import LinearAxis, Range1d
x = arange(-2*pi, 2*pi, 0.1)
y = sin(x)
y2 = linspace(0, 100, len(y))
o... | 26.038462 | 82 | 0.707533 |
6018effbd6e7f280d55f3b0ff591cfd0818938ab | 4,841 | py | Python | dls_pmaccontrol/energise.py | dls-controls/dls-pmac-control | 664ee6c3f74a60bb18e8a1cfd5a23c386da54f2c | [
"Apache-2.0"
] | null | null | null | dls_pmaccontrol/energise.py | dls-controls/dls-pmac-control | 664ee6c3f74a60bb18e8a1cfd5a23c386da54f2c | [
"Apache-2.0"
] | 7 | 2021-12-09T12:12:46.000Z | 2022-02-18T12:37:22.000Z | dls_pmaccontrol/energise.py | Observatory-Sciences/dls-pmac-control | 664ee6c3f74a60bb18e8a1cfd5a23c386da54f2c | [
"Apache-2.0"
] | 1 | 2021-05-26T11:26:46.000Z | 2021-05-26T11:26:46.000Z | # -*- coding: utf-8 -*-
import sys, re
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from formEnergise import Ui_formEnergise
class energiseform(QDialog, Ui_formEnergise):
def __init__(self, pmac, parent = None):
QDialog.__init__(self,parent)
self.setupUi(self)
self.pmac = pmac
self.parent = paren... | 36.126866 | 114 | 0.706879 |
ef66f167cb54429bcbc9988716acd373c291a572 | 33 | py | Python | chap7/7-7.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | 1 | 2022-02-21T07:05:48.000Z | 2022-02-21T07:05:48.000Z | chap7/7-7.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | null | null | null | chap7/7-7.py | StewedChickenwithStats/Answers-to-Python-Crash-Course | 9ffbe02abba5d111f702d920db7932303daf59d4 | [
"MIT"
] | null | null | null | x = 1
while x <= 5:
print(x)
| 8.25 | 13 | 0.454545 |
ae2dec01dbfe3abfff58b7ef4549a2362bc5b835 | 18,086 | py | Python | crosshair/fuzz_core_test.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/fuzz_core_test.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | crosshair/fuzz_core_test.py | samuelchassot/CrossHair | 4eac7a23e470567cc23e6d0916ce6dd6820eacd8 | [
"MIT"
] | null | null | null | import builtins
from collections.abc import Hashable, Mapping, Iterable, Sized
import copy
import enum
from inspect import isfunction
from inspect import ismethoddescriptor
from inspect import getmembers
from inspect import Parameter
from inspect import Signature
import random
import sys
import time
import unittest
imp... | 37.367769 | 114 | 0.53229 |
a0b35c4c779ecabd66f346fe88deef416338f80b | 3,730 | py | Python | evaluate.py | ishine/MultiSpeaker_FastSpeech2 | 28e2c156c8f25f3d4e3fe0d0abd0c7b61ffacaa1 | [
"MIT"
] | null | null | null | evaluate.py | ishine/MultiSpeaker_FastSpeech2 | 28e2c156c8f25f3d4e3fe0d0abd0c7b61ffacaa1 | [
"MIT"
] | null | null | null | evaluate.py | ishine/MultiSpeaker_FastSpeech2 | 28e2c156c8f25f3d4e3fe0d0abd0c7b61ffacaa1 | [
"MIT"
] | 1 | 2022-01-29T01:19:49.000Z | 2022-01-29T01:19:49.000Z | import argparse
import os
import torch
import yaml
import torch.nn as nn
from torch.utils.data import DataLoader
from utils.model import get_model, get_vocoder
from utils.tools import to_device, log, synth_one_sample
from model import FastSpeech2Loss
from dataset import Dataset
device = torch.device("... | 31.083333 | 193 | 0.593029 |
cc72098bd4450d6ab3d76beb99ac33ed47913c02 | 7,930 | py | Python | .history/pages/intro_20220308101033.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220308101033.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220308101033.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... | 28.220641 | 206 | 0.656368 |
423dad05b03ed66eba84870606a4cabc01751cdb | 389 | py | Python | mobile/mobile/wsgi.py | duartegalvao/SIRS_MobileApp | f79cc34e2572ac577540deb6c09dc643fd3c15aa | [
"MIT"
] | null | null | null | mobile/mobile/wsgi.py | duartegalvao/SIRS_MobileApp | f79cc34e2572ac577540deb6c09dc643fd3c15aa | [
"MIT"
] | null | null | null | mobile/mobile/wsgi.py | duartegalvao/SIRS_MobileApp | f79cc34e2572ac577540deb6c09dc643fd3c15aa | [
"MIT"
] | null | null | null | """
WSGI config for mobile project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
f1af29ca2a83302d9f5d7e65b5aa5f89d4f6b275 | 2,134 | py | Python | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 4 | 2018-02-06T01:53:12.000Z | 2018-02-20T01:47:36.000Z | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | null | null | null | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/__init__.py | SunguckLee/real-mongodb | fef0e44fafc6d3709a84101327e7d2f54dd18d88 | [
"Apache-2.0"
] | 3 | 2018-02-06T01:53:18.000Z | 2021-07-28T09:48:15.000Z | #
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,... | 37.438596 | 117 | 0.669166 |
f27e5b1054efb75ce76742ee8c95ff528932000b | 329 | py | Python | poppy/tests/__init__.py | neilzim/poppy | d04aa6671aec411021bec6175fcb03ee125f4005 | [
"BSD-3-Clause"
] | 141 | 2015-02-18T09:18:51.000Z | 2022-02-23T20:18:00.000Z | poppy/tests/__init__.py | neilzim/poppy | d04aa6671aec411021bec6175fcb03ee125f4005 | [
"BSD-3-Clause"
] | 462 | 2018-08-23T21:37:30.000Z | 2022-03-29T17:24:50.000Z | poppy/tests/__init__.py | neilzim/poppy | d04aa6671aec411021bec6175fcb03ee125f4005 | [
"BSD-3-Clause"
] | 52 | 2018-08-27T20:49:14.000Z | 2022-02-22T13:02:40.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.md
"""
This packages contains affiliated package tests.
"""
# Test code for POPPY - Use the function test() in poppy itself to invoke this.
#
# Test patterns based on http://ssb.stsci.edu/testing/pandokia/docs_new/helper_testfn.html
# and astropy affiliates fr... | 32.9 | 90 | 0.765957 |
9f027d88e486524b9cc0baa97c2535208b4d297c | 1,202 | py | Python | examples/convergence_comparison.py | aldanor/skggm | d2e29d692d1654285653ab07fd24534628fcb076 | [
"MIT"
] | 199 | 2016-10-21T14:36:02.000Z | 2022-03-29T20:59:08.000Z | examples/convergence_comparison.py | aldanor/skggm | d2e29d692d1654285653ab07fd24534628fcb076 | [
"MIT"
] | 66 | 2016-10-17T01:47:28.000Z | 2022-03-06T11:02:56.000Z | examples/convergence_comparison.py | aldanor/skggm | d2e29d692d1654285653ab07fd24534628fcb076 | [
"MIT"
] | 36 | 2016-10-15T23:42:10.000Z | 2022-03-06T00:03:13.000Z | """
Convergence Failure of Glasso
=============================
Demonstration of cases where graph_lasso fails to converge and quic succeeds.
"The graphical lasso: New Insights and alternatives", by Mazumder & Hastie 2012.
https://web.stanford.edu/~hastie/Papers/glassoinsights.pdf
"""
import sys
sys.path.append(".... | 27.318182 | 80 | 0.609817 |
5d2bd8d157c3ffd26807115b99c91fb2bd52664a | 5,870 | py | Python | SDL_Pi_HDC1000/SDL_Pi_HDC1000.py | zerosquadron/grove-weather-pi | 05cab7836f831546cbb2a7cd2a260e2fe15de62b | [
"MIT"
] | 1 | 2019-03-19T06:59:45.000Z | 2019-03-19T06:59:45.000Z | SDL_Pi_HDC1000/SDL_Pi_HDC1000.py | zerosquadron/grove-weather-pi | 05cab7836f831546cbb2a7cd2a260e2fe15de62b | [
"MIT"
] | null | null | null | SDL_Pi_HDC1000/SDL_Pi_HDC1000.py | zerosquadron/grove-weather-pi | 05cab7836f831546cbb2a7cd2a260e2fe15de62b | [
"MIT"
] | null | null | null | #
#
# SDL_Pi_HDC1000
# Raspberry Pi Driver for the SwitchDoc Labs HDC1000 Breakout Board
#
# SwitchDoc Labs
# January 2017
#
# Version 1.1
#constants
# I2C Address
HDC1000_ADDRESS = (0x40) # 1000000
# Registers
HDC1000_TEMPERATURE_REGISTER = (0x00)
HDC1000_HUMIDITY_REGISTER = ... | 33.352273 | 100 | 0.617036 |
ead118f3e1182a9fb03a549234a732f9aa0cb5b8 | 1,643 | py | Python | proyectos/2/GarciaVicente-GuerreroEnrique/PanelControl.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | proyectos/2/GarciaVicente-GuerreroEnrique/PanelControl.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | proyectos/2/GarciaVicente-GuerreroEnrique/PanelControl.py | Miguelp-rez/sistop-2019-2 | 428444217ba0cc98030a9d84d8b415dcddad9b65 | [
"CC-BY-4.0"
] | null | null | null | # -*- Encoding: utf-8 -*-
from tkinter import *
import time
import os
raiz=Tk()
raiz.title("Menú")
raiz.resizable(0,0)
raiz.geometry("800x500")
raiz.config(bg="yellow green")
#bit = raiz.iconbitmap("bus.ico")
def iniciar():
lbl2 = Label(raiz,text="Programa finalizado",font=("Arial Bold",35),background = "yellow gree... | 28.327586 | 114 | 0.704808 |
7d4736a6d2163bf79bf79d70e9effb9a771809e5 | 7,982 | py | Python | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | 1 | 2019-11-18T11:35:36.000Z | 2019-11-18T11:35:36.000Z | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.313131 | 79 | 0.640817 |
c942fe491e6660dec7cb4bba9309456c85b79c22 | 349 | py | Python | crystalball/shortcuts.py | 7ws/python-crystalball | 81acb6ff08b3a77af54ec7822850ab2926b87e9f | [
"MIT"
] | 1 | 2017-01-23T18:18:14.000Z | 2017-01-23T18:18:14.000Z | crystalball/shortcuts.py | 7ws/python-crystalball | 81acb6ff08b3a77af54ec7822850ab2926b87e9f | [
"MIT"
] | null | null | null | crystalball/shortcuts.py | 7ws/python-crystalball | 81acb6ff08b3a77af54ec7822850ab2926b87e9f | [
"MIT"
] | null | null | null | import io
from . import parser
def parse(something):
"""
A shortcut to the main parser class
"""
# Check if we have a file-like object
if isinstance(something, io.IOBase):
content = something.read()
# Fallback to the original value
else:
content = something
return pa... | 18.368421 | 41 | 0.644699 |
89ec6444c6bbfa6b4b8c0759bb5ae87a4ae3147a | 704 | py | Python | qualkit/sentiment.py | JiscDACT/qualkit | e8ce2d9318d6d1b16ca5dc6809a068aec3a11118 | [
"BSD-3-Clause"
] | 1 | 2022-01-01T23:12:10.000Z | 2022-01-01T23:12:10.000Z | qualkit/sentiment.py | JiscDACT/qualkit | e8ce2d9318d6d1b16ca5dc6809a068aec3a11118 | [
"BSD-3-Clause"
] | null | null | null | qualkit/sentiment.py | JiscDACT/qualkit | e8ce2d9318d6d1b16ca5dc6809a068aec3a11118 | [
"BSD-3-Clause"
] | null | null | null | import nltk
from nltk.sentiment import SentimentIntensityAnalyzer
nltk.download('vader_lexicon')
def add_sentiment_score(data, column, filter=None):
data = data.copy()
sia = SentimentIntensityAnalyzer()
data['sentiment'] = data[column].apply(lambda x: sia.polarity_scores(x)['compound'])
if filter == ... | 33.52381 | 88 | 0.664773 |
264fd95fa5768ffb59f484cbebe1b98f2f72d579 | 107,838 | py | Python | examples/membership/libs/figrc.py | kmcquinn/match | e92a23de28eab13b6b01c5d8fc48086bc1551bd7 | [
"MIT"
] | null | null | null | examples/membership/libs/figrc.py | kmcquinn/match | e92a23de28eab13b6b01c5d8fc48086bc1551bd7 | [
"MIT"
] | null | null | null | examples/membership/libs/figrc.py | kmcquinn/match | e92a23de28eab13b6b01c5d8fc48086bc1551bd7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
import os
import sys
sys.path.append(os.getenv('HOME') + '/bin/python/libs')
# just in case notebook was not launched with the option
# %pylab inline
import pylab as plt
import numpy as np
from scipy import spa... | 34.955592 | 123 | 0.55282 |
2a11b5d8446705e37de0c6b23bd65dafa80b9344 | 107 | py | Python | tests/card/generators/__main__.py | hinihatetsu/ygo-core-python | ee9a2080d69c16679057d5fa8a62bf642cb071ed | [
"MIT"
] | null | null | null | tests/card/generators/__main__.py | hinihatetsu/ygo-core-python | ee9a2080d69c16679057d5fa8a62bf642cb071ed | [
"MIT"
] | null | null | null | tests/card/generators/__main__.py | hinihatetsu/ygo-core-python | ee9a2080d69c16679057d5fa8a62bf642cb071ed | [
"MIT"
] | null | null | null | from . import attribute
from . import location
from . import position
from . import race
from . import type | 21.4 | 23 | 0.775701 |
7292171f1a5709791f28a95830c5cdddc1217f6d | 11,378 | py | Python | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/inventory/cobbler.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/inventory/cobbler.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/inventory/cobbler.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Orion Poplawski <orion@nwra.com>
# Copyright (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | 40.928058 | 148 | 0.602391 |
faff96dbcfb7c94cc469110e51bcd35f824c7725 | 202 | py | Python | config.py | geraldzakwan/tajong.ai | 69aaedbf00d068f6a5744855953c60807b88af69 | [
"MIT"
] | 2 | 2020-11-21T06:08:46.000Z | 2021-01-12T22:05:28.000Z | config.py | geraldzakwan/tajong.ai | 69aaedbf00d068f6a5744855953c60807b88af69 | [
"MIT"
] | null | null | null | config.py | geraldzakwan/tajong.ai | 69aaedbf00d068f6a5744855953c60807b88af69 | [
"MIT"
] | 1 | 2021-01-08T16:50:09.000Z | 2021-01-08T16:50:09.000Z | configs = {
"DEPLOY_ENV": {
"prod": {
"PORT": 5000,
"DEBUG": False
},
"dev": {
"PORT": 5001,
"DEBUG": True
}
}
}
| 14.428571 | 26 | 0.292079 |
8be46ded27f3239dad2ecb0bcd60c8e7f0526846 | 165 | py | Python | success/apps.py | gtoffoli/commons-success | fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295 | [
"Apache-2.0"
] | null | null | null | success/apps.py | gtoffoli/commons-success | fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295 | [
"Apache-2.0"
] | null | null | null | success/apps.py | gtoffoli/commons-success | fcd2b5fe9ebdc592841e6fe0e07a1d80c7284295 | [
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
import commons
class SuccessConfig(AppConfig):
name = 'success'
def ready(self):
import commons.signal_handlers
| 16.5 | 38 | 0.727273 |
15db1142873a7a8316ded949a2a0a4476cc0ae90 | 2,046 | py | Python | fix_corrupted_img.py | abdoulsn/chien-chat-tensorflow | 73a9061c085356054782859e59191a90a851fd5c | [
"MIT"
] | null | null | null | fix_corrupted_img.py | abdoulsn/chien-chat-tensorflow | 73a9061c085356054782859e59191a90a851fd5c | [
"MIT"
] | null | null | null | fix_corrupted_img.py | abdoulsn/chien-chat-tensorflow | 73a9061c085356054782859e59191a90a851fd5c | [
"MIT"
] | null | null | null | import io
import os
import sys
import tensorflow as tf
import PIL
def main(argv, path_images):
filenames_src = tf.io.gfile.listdir(path_images)
for filename_src in filenames_src:
stem, extension = os.path.splitext(filename_src)
#print(extension)
if (extension.lower() != '.jpg'): c... | 46.5 | 116 | 0.615836 |
e39e52abe271b34c06187b9dbabdfe6e1ae9918f | 15,813 | py | Python | tests/test_response.py | kotarotanahashi/dimod | 256b7f59c571e16cc562443a1a5388ebdcd3a5e4 | [
"Apache-2.0"
] | null | null | null | tests/test_response.py | kotarotanahashi/dimod | 256b7f59c571e16cc562443a1a5388ebdcd3a5e4 | [
"Apache-2.0"
] | null | null | null | tests/test_response.py | kotarotanahashi/dimod | 256b7f59c571e16cc562443a1a5388ebdcd3a5e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems 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... | 44.294118 | 120 | 0.535825 |
b832544a8d7df02c5684b33d1afede4e3ce7462d | 3,096 | py | Python | speech-synthesis/WaveGlow/hparams.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 228 | 2017-11-20T06:05:56.000Z | 2022-03-23T12:40:05.000Z | speech-synthesis/WaveGlow/hparams.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 36 | 2018-01-11T23:26:20.000Z | 2022-03-12T00:53:38.000Z | speech-synthesis/WaveGlow/hparams.py | AaratiAkkapeddi/nnabla-examples | db9e5ad850303c158773aeb275e5c3821b4a3935 | [
"Apache-2.0"
] | 76 | 2017-11-22T22:00:00.000Z | 2022-03-28T05:58:57.000Z | # Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 46.909091 | 94 | 0.61854 |
31e245c2544e7e2c49e5cf080c2c808066ef13f6 | 3,363 | py | Python | main.py | MetLee/waka-readme | 21e5b9c804d8a1036a7571bc29f1758cd81a98fa | [
"MIT"
] | null | null | null | main.py | MetLee/waka-readme | 21e5b9c804d8a1036a7571bc29f1758cd81a98fa | [
"MIT"
] | null | null | null | main.py | MetLee/waka-readme | 21e5b9c804d8a1036a7571bc29f1758cd81a98fa | [
"MIT"
] | null | null | null | '''
WakaTime progress visualizer
'''
import re
import os
import base64
import sys
import datetime
import requests
from github import Github, GithubException
START_COMMENT = '<!--START_SECTION:waka-->'
END_COMMENT = '<!--END_SECTION:waka-->'
listReg = f"{START_COMMENT}[\\s\\S]+{END_COMMENT}"
user = os.getenv('INPUT_U... | 34.316327 | 161 | 0.645257 |
180742dc45455e82b9b7ed1526a464fe493d1349 | 3,586 | py | Python | AdvBox/attacks/single_pixel_attack.py | jayxio/PaddleSleeve | 266475312d1290ad58652fb0a3d680958549deed | [
"Apache-2.0"
] | 41 | 2021-05-10T10:34:23.000Z | 2022-02-24T08:48:16.000Z | AdvBox/attacks/single_pixel_attack.py | Tough2011/PaddleSleeve | e654598a370220fbbc96ae527833676183909383 | [
"Apache-2.0"
] | 12 | 2021-06-07T14:22:42.000Z | 2022-03-16T11:56:45.000Z | AdvBox/attacks/single_pixel_attack.py | Tough2011/PaddleSleeve | e654598a370220fbbc96ae527833676183909383 | [
"Apache-2.0"
] | 14 | 2021-05-10T10:22:55.000Z | 2022-02-14T01:44:17.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 30.649573 | 97 | 0.624651 |
e48acb9c6d4544a0f885d1fa80036d7acb0f4613 | 569 | py | Python | rlkit/envs/goal_env_utils.py | Ericonaldo/ILSwiss | efd25d457fd1578005c6fbc45cae29e9ab64a99d | [
"MIT"
] | 46 | 2021-07-28T03:15:23.000Z | 2022-03-31T22:19:22.000Z | rlkit/envs/goal_env_utils.py | Ericonaldo/ILSwiss | efd25d457fd1578005c6fbc45cae29e9ab64a99d | [
"MIT"
] | 3 | 2021-07-30T09:55:01.000Z | 2022-03-17T17:21:26.000Z | rlkit/envs/goal_env_utils.py | Ericonaldo/ILSwiss | efd25d457fd1578005c6fbc45cae29e9ab64a99d | [
"MIT"
] | 5 | 2021-07-28T16:45:14.000Z | 2022-03-11T01:39:19.000Z | import numpy as np
def goal_distance(goal_a, goal_b, distance_threshold=0.05):
return np.linalg.norm(goal_a - goal_b, ord=2, axis=-1)
def goal_distance_obs(obs, distance_threshold=0.05):
return goal_distance(obs['achieved_goal'], obs['desired_goal'], distance_threshold=distance_threshold)
def compute_reward(self,... | 37.933333 | 103 | 0.768014 |
33fd48a256a6a80b9eb4ee27c9e0a7e8d10cf345 | 111,952 | py | Python | tests/python/unittest/test_gluon.py | piotrwolinski-intel/incubator-mxnet | 9152b9078fa862099dc479d35ae8c26120b2c3c9 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_gluon.py | piotrwolinski-intel/incubator-mxnet | 9152b9078fa862099dc479d35ae8c26120b2c3c9 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_gluon.py | piotrwolinski-intel/incubator-mxnet | 9152b9078fa862099dc479d35ae8c26120b2c3c9 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.394246 | 119 | 0.594344 |
ef4abb92a32b75a5c360e99b72addb5901a8cdbb | 4,056 | py | Python | influxdb_client/domain/variable_links.py | Rajpratik71/influxdb-client-python | ae537018b638600552b3ac11f1b070c048719910 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_links.py | Rajpratik71/influxdb-client-python | ae537018b638600552b3ac11f1b070c048719910 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_links.py | Rajpratik71/influxdb-client-python | ae537018b638600552b3ac11f1b070c048719910 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service.
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class VariableLinks(objec... | 26 | 120 | 0.545858 |
d37cdcd77a0708fb217575259154390f89c5e0bb | 7,530 | py | Python | geoviews/tests/data/test_geopandas.py | pmav99/geoviews | ad6e3f028b0532fdf604a92ffca3238c2bd8ef4f | [
"BSD-3-Clause"
] | 172 | 2019-11-18T17:30:53.000Z | 2022-03-31T21:36:41.000Z | geoviews/tests/data/test_geopandas.py | pmav99/geoviews | ad6e3f028b0532fdf604a92ffca3238c2bd8ef4f | [
"BSD-3-Clause"
] | 166 | 2019-11-14T05:21:03.000Z | 2022-03-07T17:20:00.000Z | geoviews/tests/data/test_geopandas.py | pmav99/geoviews | ad6e3f028b0532fdf604a92ffca3238c2bd8ef4f | [
"BSD-3-Clause"
] | 24 | 2019-11-29T06:20:31.000Z | 2021-12-23T00:58:06.000Z | """
Test for the GeoPandasInterface
"""
from unittest import SkipTest
import numpy as np
from shapely import geometry as sgeom
try:
import geopandas
from geopandas.array import GeometryDtype
except:
geopandas = None
from holoviews.core.util import pd
from holoviews.core.data import Dataset
from holoview... | 42.303371 | 104 | 0.523639 |
11c69d6f17e4ed661f76e5a46b7af1a3b0b23ce0 | 6,406 | py | Python | lib/downloader.py | SarthakYadav/kinetics-downloader | c59911b736623e5dd03935634e8e44c17e26a585 | [
"MIT"
] | null | null | null | lib/downloader.py | SarthakYadav/kinetics-downloader | c59911b736623e5dd03935634e8e44c17e26a585 | [
"MIT"
] | null | null | null | lib/downloader.py | SarthakYadav/kinetics-downloader | c59911b736623e5dd03935634e8e44c17e26a585 | [
"MIT"
] | null | null | null | import os, subprocess
def download_video(video_id, download_path, video_format="mp4", log_file=None):
"""
Download video from YouTube.
:param video_id: YouTube ID of the video.
:param download_path: Where to save the video.
:param video_format: Format to download.
:param log_file: Path t... | 35.787709 | 160 | 0.656884 |
742937842f30c0bca8a899413151a8aa02589925 | 13,499 | py | Python | openstack/tests/unit/cdn/v1/test_domain.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cdn/v1/test_domain.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cdn/v1/test_domain.py | IamFive/sdk-python | 223b04f90477f7de0f00b3e652d8672ba73271c8 | [
"ECL-2.0",
"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 t... | 35.71164 | 76 | 0.512556 |
9d35c125e840c77b9393ee9d02f697e2d6093e91 | 20,016 | py | Python | fuji_server/client/ex_evaluate.py | sneumann/fuji | 55b63e9e901ff7fee4d92fc42dec6b5753d67016 | [
"MIT"
] | null | null | null | fuji_server/client/ex_evaluate.py | sneumann/fuji | 55b63e9e901ff7fee4d92fc42dec6b5753d67016 | [
"MIT"
] | null | null | null | fuji_server/client/ex_evaluate.py | sneumann/fuji | 55b63e9e901ff7fee4d92fc42dec6b5753d67016 | [
"MIT"
] | 1 | 2021-02-18T16:58:10.000Z | 2021-02-18T16:58:10.000Z | #!/usr/bin/env python3
import configparser as ConfigParser
import io
import json
import logging
import os
from pathlib import Path
from fuji_server.controllers.fair_check import FAIRCheck
from fuji_server.helper.preprocessor import Preprocessor
import gc
import tracemalloc
# os
#os.environ['TIKA_SERVER_JAR'] = 'file:/... | 68.783505 | 435 | 0.732714 |
aa005d63c51fe5ee60771941c98fa3eaf5482fc9 | 1,068 | py | Python | SuperPortal/views.py | elryndir/GuildPortal | d9604bdffdca93debcf5a4063b56e7f0efcc49fd | [
"MIT"
] | null | null | null | SuperPortal/views.py | elryndir/GuildPortal | d9604bdffdca93debcf5a4063b56e7f0efcc49fd | [
"MIT"
] | null | null | null | SuperPortal/views.py | elryndir/GuildPortal | d9604bdffdca93debcf5a4063b56e7f0efcc49fd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.http import HttpResponse
from django.shortcuts import render
from django.views.generic import View, TemplateView, ListView
from .models import GuildSettings
from Portal.models import News, Userprofile
from PortalEnrollment.models import EnrollmentSettings
# Create your views here.
... | 31.411765 | 94 | 0.749064 |
1a50df2b868142b74dbe1f4c4d460b8c41c36854 | 1,033 | py | Python | stix_shifter_modules/trendmicro_vision_one/stix_transmission/ping_connector.py | priti-patil/stix-shifter | 26954598fb79dde4506987388592ec391ff8a10b | [
"Apache-2.0"
] | 33 | 2018-05-25T17:07:28.000Z | 2019-09-30T10:08:53.000Z | stix_shifter_modules/trendmicro_vision_one/stix_transmission/ping_connector.py | priti-patil/stix-shifter | 26954598fb79dde4506987388592ec391ff8a10b | [
"Apache-2.0"
] | 54 | 2018-06-01T18:17:24.000Z | 2019-09-30T18:36:15.000Z | stix_shifter_modules/trendmicro_vision_one/stix_transmission/ping_connector.py | subbyte/stix-shifter | 36d71c172a5fc5b97d872e623753b0dd1bf4fe6c | [
"Apache-2.0"
] | 37 | 2018-07-24T13:29:46.000Z | 2019-09-29T19:06:27.000Z | from stix_shifter_utils.modules.base.stix_transmission.base_ping_connector import BasePingConnector
from stix_shifter_utils.utils import logger
from stix_shifter_utils.utils.error_response import ErrorResponder
class PingConnector(BasePingConnector):
def __init__(self, api_client):
self.api_client = api_c... | 38.259259 | 107 | 0.667957 |
a5153ee0f6b98e6167a163ea6bff51d2f2c9d4d4 | 3,379 | py | Python | StockDao.py | dssheldon/data-representation-project | c31694f9ec5909234e931d07824684321eef7162 | [
"MIT"
] | null | null | null | StockDao.py | dssheldon/data-representation-project | c31694f9ec5909234e931d07824684321eef7162 | [
"MIT"
] | null | null | null | StockDao.py | dssheldon/data-representation-project | c31694f9ec5909234e931d07824684321eef7162 | [
"MIT"
] | null | null | null | # Data Represenation Big Project
# Created By: Sheldon D'Souza - G00387857
import mysql.connector
from mysql.connector import cursor
import db1config as cfg
# Py file to connect to the database and perform CRUD operations on the datbase
# mysql operations are perfromed throughout the workbook
class StockDao:
d... | 29.12931 | 99 | 0.560225 |
5fe89287aeb4fe7a45d82ae19334c73ee1cfb86b | 1,959 | py | Python | examples/frontal_line_of_sight_observation.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 6 | 2020-10-15T14:45:11.000Z | 2021-02-20T12:11:32.000Z | examples/frontal_line_of_sight_observation.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 5 | 2021-01-20T15:34:29.000Z | 2022-03-18T18:52:53.000Z | examples/frontal_line_of_sight_observation.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 2 | 2021-01-11T18:48:49.000Z | 2021-01-26T15:45:38.000Z | from typing import Optional
import numpy.random as rnd
from gym_gridverse.agent import Agent
from gym_gridverse.geometry import Orientation, Position
from gym_gridverse.grid_object import Hidden
from gym_gridverse.observation import Observation
from gym_gridverse.spaces import ObservationSpace
from gym_gridverse.stat... | 34.982143 | 77 | 0.717713 |
37e436be11b55e0f687092469d73bc58fd8b8dbb | 16,576 | py | Python | atomshields/scanner.py | 5l1v3r1/AtomShields | e75f25393b4a7a315ec96bf9b8e654cb2200866a | [
"Apache-2.0"
] | 13 | 2019-01-28T03:48:59.000Z | 2021-02-03T12:57:11.000Z | atomshields/scanner.py | ElevenPaths/AtomShields | e75f25393b4a7a315ec96bf9b8e654cb2200866a | [
"Apache-2.0"
] | null | null | null | atomshields/scanner.py | ElevenPaths/AtomShields | e75f25393b4a7a315ec96bf9b8e654cb2200866a | [
"Apache-2.0"
] | 4 | 2019-03-28T15:51:15.000Z | 2021-02-01T00:51:51.000Z | # -*- coding:utf8 -*-
import os
import shutil
import glob
import ast
import sys
import collections
from datetime import datetime
from ConfigParser import ConfigParser
from termcolor import colored
from models import Issue
class AtomShieldsScanner(object):
"""
Class in charge of orchestrating the execution of the ch... | 26.692432 | 173 | 0.704935 |
eb2114f2aec41d3ca62c6e54d79e5441da10d0a8 | 873 | py | Python | atlas/aws_utils/setup.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 296 | 2020-03-16T19:55:00.000Z | 2022-01-10T19:46:05.000Z | atlas/aws_utils/setup.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 57 | 2020-03-17T11:15:57.000Z | 2021-07-10T14:42:27.000Z | atlas/aws_utils/setup.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 38 | 2020-03-17T21:06:05.000Z | 2022-02-08T03:19:34.000Z |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path, environ
here = path.abspath(path.dirname(__file__))
build_version = environ.get('build_version', '0.0.0')
with open(path.join(here, 'README.md'), encoding=... | 27.28125 | 63 | 0.655212 |
757131b985b079d61b9462fb91816eb209c30cb4 | 3,175 | py | Python | scripts/helpful_scripts.py | nazihkalo/smartcontract-lottery | 6befcaadfad73db1b33bea6dc637c2a6cdecc012 | [
"MIT"
] | null | null | null | scripts/helpful_scripts.py | nazihkalo/smartcontract-lottery | 6befcaadfad73db1b33bea6dc637c2a6cdecc012 | [
"MIT"
] | null | null | null | scripts/helpful_scripts.py | nazihkalo/smartcontract-lottery | 6befcaadfad73db1b33bea6dc637c2a6cdecc012 | [
"MIT"
] | null | null | null | from os import link
from brownie import (
network,
config,
accounts,
MockV3Aggregator,
VRFCoordinatorMock,
LinkToken,
Contract,
interface,
)
DECIMALS = 8
STARTING_PRICE = 4000 * 10 ** 8
LOCAL_DEV_ENVIRONMENTS = ["ganache-local", "development"]
FORKED_MAINNET_ENVIRONMENTS = ["mainnet-for... | 33.072917 | 106 | 0.687874 |
5bd565dbe5d36f22d60dd620e0a6be81f5e05ee3 | 5,872 | py | Python | marshmallowjson/marshmallowjson.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 1 | 2018-04-10T15:39:14.000Z | 2018-04-10T15:39:14.000Z | marshmallowjson/marshmallowjson.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 299 | 2018-01-28T22:27:20.000Z | 2022-03-28T09:15:18.000Z | marshmallowjson/marshmallowjson.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 1 | 2019-09-20T01:36:52.000Z | 2019-09-20T01:36:52.000Z | """Main module."""
import collections
import json
from marshmallow import Schema, fields, validate
from marshmallowjson import ValidationError
DEFAULT_FIELDS = {
'raw': fields.Raw,
'dict': fields.Dict,
'string': fields.String,
'uuid': fields.UUID,
'number': fields.Number,
'integer': fields.In... | 34.541176 | 76 | 0.498978 |
3562ff5758be0ba917613733a3f83cae169f0f89 | 2,157 | py | Python | api/managed_users/tests.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | 2 | 2019-12-30T02:21:51.000Z | 2020-10-18T08:09:54.000Z | api/managed_users/tests.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | null | null | null | api/managed_users/tests.py | Codebiosys/oauth-microservice | a87796bff41bed745878bafab3ccf06e346c43e9 | [
"MIT"
] | 2 | 2018-12-06T21:08:24.000Z | 2018-12-06T21:16:02.000Z | from unittest import mock
from django.test import TestCase
class CreateRemoteUserMixinTestCase(TestCase):
@mock.patch('django.core.mail.EmailMultiAlternatives.send')
@mock.patch('django.template.loader.render_to_string')
def test_send_mail(self, render_to_string, send):
from managed_users.mixins... | 32.19403 | 88 | 0.666203 |
61507fe895cb661475b6a42662fa904903fdf989 | 10,694 | py | Python | wagtail/core/tests/tests.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | 3 | 2019-05-14T13:43:08.000Z | 2021-11-09T11:27:18.000Z | wagtail/core/tests/tests.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | 2 | 2021-03-11T01:00:22.000Z | 2021-05-09T01:58:23.000Z | wagtail/core/tests/tests.py | simo97/wagtail | ef404c775559722b9ad6be61a2cc6d6ca6ed8f69 | [
"BSD-3-Clause"
] | 1 | 2020-01-21T13:23:46.000Z | 2020-01-21T13:23:46.000Z | from django import template
from django.core.cache import cache
from django.http import HttpRequest
from django.test import TestCase
from django.utils.safestring import SafeText
from wagtail.core.models import Page, Site
from wagtail.core.templatetags.wagtailcore_tags import richtext, slugurl
from wagtail.core.utils i... | 39.316176 | 115 | 0.672527 |
99dd65dcc40dd65b9a76717e37a0996d80da468e | 7,216 | py | Python | vcert/connection_fake.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | 1 | 2018-12-30T16:59:47.000Z | 2018-12-30T16:59:47.000Z | vcert/connection_fake.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | null | null | null | vcert/connection_fake.py | arykalin/vcert-python | eeda50e641ca306862c8fe3fbca879aa3d10367a | [
"Apache-2.0"
] | 1 | 2018-12-30T07:20:51.000Z | 2018-12-30T07:20:51.000Z | import logging as log
import time
from oscrypto import asymmetric
from certbuilder import CertificateBuilder, pem_armor_certificate
import uuid
from .common import CommonConnection, Zone
ROOT_CA = b"""-----BEGIN CERTIFICATE-----
MIID1TCCAr2gAwIBAgIJAIOVTvMIMD7OMA0GCSqGSIb3DQEBCwUAMIGAMQswCQYD
VQQGEwJVUzENMAsGA1UECAwE... | 45.670886 | 116 | 0.767461 |
6b7cd556774a3e33a04b2bf004f77bb40f1dfb05 | 15,093 | py | Python | ToolKit/cmds/python/Lib/distutils/bcppcompiler.py | kontais/EFI-MIPS | c4de746e6a926fc9df71231a539e2c0a170bcc90 | [
"BSD-3-Clause"
] | 11 | 2016-07-21T11:39:51.000Z | 2022-01-06T10:35:12.000Z | ToolKit/cmds/python/Lib/distutils/bcppcompiler.py | kontais/EFI-MIPS | c4de746e6a926fc9df71231a539e2c0a170bcc90 | [
"BSD-3-Clause"
] | 1 | 2019-09-03T04:11:46.000Z | 2019-09-03T04:11:46.000Z | ToolKit/cmds/python/Lib/distutils/bcppcompiler.py | kontais/EFI-MIPS | c4de746e6a926fc9df71231a539e2c0a170bcc90 | [
"BSD-3-Clause"
] | 3 | 2019-09-04T02:59:01.000Z | 2021-08-23T06:07:28.000Z | """distutils.bcppcompiler
Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
"""
# This implementation by Lyle Johnson, based on the original msvccompiler.py
# module and using the directions originally published by Gordon Williams.
# XXX looks like there's a L... | 37.827068 | 80 | 0.547737 |
81a5693f5415474d8d11a10b489fe394cb20be16 | 4,631 | py | Python | utils/covTxnAnalysis.py | lhilbert/active-microemulsion | c0514f148d673501d1966e2d65a4568b26b8bacb | [
"BSD-2-Clause"
] | 2 | 2020-05-01T19:45:39.000Z | 2022-02-20T06:47:25.000Z | utils/covTxnAnalysis.py | lhilbert/active-microemulsion | c0514f148d673501d1966e2d65a4568b26b8bacb | [
"BSD-2-Clause"
] | 33 | 2018-08-20T08:36:38.000Z | 2019-08-07T18:48:38.000Z | utils/covTxnAnalysis.py | lhilbert/active-microemulsion | c0514f148d673501d1966e2d65a4568b26b8bacb | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# covRnaAnalysis.py
# Script for analyzing simulated "microscopy" images generated by active-microemulsion, it plots trajectories of
# simulations in the RNA intensity vs. DNA CoV plane.
#
import numpy as np
import os
from utilsLib import Plotter, FileSequence, CsvWriter, CurveAnalysis
from ut... | 44.961165 | 120 | 0.700497 |
3dbc89cdacf59de8b5f87186d3f68308770e186e | 3,284 | py | Python | Project_Euler/04_palidrome_product/palidrome_product_2.py | perlygatekeeper/glowing-robot | 7ef5eb089f552a1de309092606c95e805e6723a0 | [
"Artistic-2.0"
] | 2 | 2015-06-05T15:40:06.000Z | 2020-03-19T17:08:37.000Z | Project_Euler/04_palidrome_product/palidrome_product_2.py | perlygatekeeper/glowing-robot | 7ef5eb089f552a1de309092606c95e805e6723a0 | [
"Artistic-2.0"
] | null | null | null | Project_Euler/04_palidrome_product/palidrome_product_2.py | perlygatekeeper/glowing-robot | 7ef5eb089f552a1de309092606c95e805e6723a0 | [
"Artistic-2.0"
] | null | null | null | #!/opt/local/bin/python
# Python program to find largest palidrome product
import sys
import math
import timeit
import time
def sieveOfSundaram(n=1000):
# this version returns a dictionary for quick lookup and
# therefore verification if some number in range is a prime or composite
k = int(( n - 2 ) /... | 30.12844 | 114 | 0.537454 |
550a3fe585f476058aab8fb04c23a0dd13e0f2a5 | 6,131 | py | Python | src/ImageNetFineTune/RoadSegmentDataset.py | guemues/road-segmentation | 6c21a96ac29fb18bf7d46f35edf521f3e4574b1f | [
"MIT"
] | null | null | null | src/ImageNetFineTune/RoadSegmentDataset.py | guemues/road-segmentation | 6c21a96ac29fb18bf7d46f35edf521f3e4574b1f | [
"MIT"
] | null | null | null | src/ImageNetFineTune/RoadSegmentDataset.py | guemues/road-segmentation | 6c21a96ac29fb18bf7d46f35edf521f3e4574b1f | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
class RoadSegmentDataset(Dataset):
"""
Class used by pytorch DataLoader.
When asked object[idx], returns a crop of the image with the... | 49.048 | 127 | 0.594846 |
ba2ce081daed941e1b864c15890f01d150c075fc | 2,215 | py | Python | classification/classification.py | annisann/SixPackTeamApp | 5e2d2f6325650bdf5b406876270dd9dbbfda9491 | [
"MIT"
] | 8 | 2021-06-08T05:02:44.000Z | 2021-07-24T10:28:05.000Z | classification/classification.py | annisann/SixPackTeamApp | 5e2d2f6325650bdf5b406876270dd9dbbfda9491 | [
"MIT"
] | null | null | null | classification/classification.py | annisann/SixPackTeamApp | 5e2d2f6325650bdf5b406876270dd9dbbfda9491 | [
"MIT"
] | 3 | 2021-06-09T04:37:14.000Z | 2022-01-10T02:38:21.000Z | # -*- coding: utf-8 -*-
"""classification.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nLypOrlZlOzCLS6bYhdWs9XGVTdYd9Cd
"""
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow_hub as hub
"""**Load Dataset**"""
... | 29.144737 | 117 | 0.746727 |
b308da2302d5a3824a9ef81b7f61a5134cef1d12 | 350 | py | Python | django_redis/serializers/json.py | cashaev/django-redis | cd584c9bec034153e23c222d5dab4d57f991ea81 | [
"BSD-3-Clause"
] | 4 | 2020-07-05T21:15:38.000Z | 2021-04-09T05:42:19.000Z | django_redis/serializers/json.py | cashaev/django-redis | cd584c9bec034153e23c222d5dab4d57f991ea81 | [
"BSD-3-Clause"
] | 5 | 2021-05-28T19:38:28.000Z | 2022-03-12T00:45:39.000Z | env/lib/python3.9/site-packages/django_redis/serializers/json.py | simotwo/AbileneParadox-ddd | c85961efb37aba43c0d99ed1c36d083507e2b2d3 | [
"MIT"
] | 1 | 2020-08-20T10:19:01.000Z | 2020-08-20T10:19:01.000Z | import json
from django.core.serializers.json import DjangoJSONEncoder
from .base import BaseSerializer
class JSONSerializer(BaseSerializer):
encoder_class = DjangoJSONEncoder
def dumps(self, value):
return json.dumps(value, cls=self.encoder_class).encode()
def loads(self, value):
retu... | 21.875 | 65 | 0.74 |
61cfd7fdb77edfdf71f8c326ec4a40bbb62feb06 | 362 | py | Python | Desafio/ex076.py | NathanMuniz/Exercises-Python | 21dcf5fafdc3bd20baec997986b3ae97f5e08784 | [
"MIT"
] | null | null | null | Desafio/ex076.py | NathanMuniz/Exercises-Python | 21dcf5fafdc3bd20baec997986b3ae97f5e08784 | [
"MIT"
] | null | null | null | Desafio/ex076.py | NathanMuniz/Exercises-Python | 21dcf5fafdc3bd20baec997986b3ae97f5e08784 | [
"MIT"
] | null | null | null | Listagem = 'Lápis',1.7, 'Borracha',2,'Caderno',15.90,'Estojo',25,'Tranferidor',4.20,'Compasso',9.99
print('-'*20)
print('Lista de Preços')
print('-'*20)
for iten in range(0, len(Listagem, )):
if iten % 2 == 0:
print('Eu Comprei Um ', end='')
print(f'{Listagem[iten]:.<30}', end='')
else:
... | 30.166667 | 99 | 0.569061 |
ec4b84382ebccb4fa005afe995f40f90e26f377b | 1,054 | py | Python | lib/sim900/amsharedmini.py | viable-hartman/sim-module | bf991c01bda92ed95fc8345ce6f43d07336e70b5 | [
"MIT"
] | 61 | 2015-07-10T00:41:15.000Z | 2021-06-10T22:23:13.000Z | lib/sim900/amsharedmini.py | viable-hartman/sim-module | bf991c01bda92ed95fc8345ce6f43d07336e70b5 | [
"MIT"
] | 9 | 2015-08-21T14:03:25.000Z | 2017-08-16T08:33:27.000Z | lib/sim900/amsharedmini.py | viable-hartman/sim-module | bf991c01bda92ed95fc8345ce6f43d07336e70b5 | [
"MIT"
] | 30 | 2015-05-09T02:05:30.000Z | 2020-11-05T13:52:24.000Z | __author__ = 'Bohdan'
import time
class AminisLastErrorHolder:
def __init__(self):
self.errorText = ""
self.__hasError = False
def clearError(self):
self.errorText = ""
self.__hasError = False
def setError(self, errorText):
self.errorText = errorText
se... | 18.821429 | 45 | 0.581594 |
67e0d28fa631619fbac0a60f5d1ff5f27545694d | 6,963 | py | Python | sdk/python/pulumi_azure_native/kusto/get_event_hub_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/get_event_hub_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/kusto/get_event_hub_connection.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
__a... | 39.338983 | 193 | 0.663938 |
65d7b762e436eadf338477c2e3bb6fbcdb947cd8 | 1,834 | py | Python | stwfsapy/tests/thesaurus/conftest.py | zbw/stwfsapy | 4f57de2d218015b10719d2357b048c2b6d8b4744 | [
"Apache-2.0"
] | 2 | 2020-12-04T09:23:22.000Z | 2022-02-28T22:57:55.000Z | stwfsapy/tests/thesaurus/conftest.py | zbw/stwfsapy | 4f57de2d218015b10719d2357b048c2b6d8b4744 | [
"Apache-2.0"
] | 21 | 2020-08-17T14:26:07.000Z | 2021-04-29T07:56:15.000Z | stwfsapy/tests/thesaurus/conftest.py | zbw/stwfsapy | 4f57de2d218015b10719d2357b048c2b6d8b4744 | [
"Apache-2.0"
] | 1 | 2020-12-09T08:32:02.000Z | 2020-12-09T08:32:02.000Z | # Copyright 2020-2021 Leibniz Information Centre for Economics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 26.57971 | 74 | 0.685932 |
5faf43c30c9219dd254c0946a53421ce94e6f0f2 | 1,396 | py | Python | app/core/tests/test_admin.py | muz110/recipe-app-api | 439a7c89b4411f2ec342d1917446338bec640f2a | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | muz110/recipe-app-api | 439a7c89b4411f2ec342d1917446338bec640f2a | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | muz110/recipe-app-api | 439a7c89b4411f2ec342d1917446338bec640f2a | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import Client
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='ad... | 30.347826 | 68 | 0.641117 |
252eedf9d23b389b313702a1b26e7e3dd24da1a3 | 469 | py | Python | InputFunctions.py | medmatix/DataSciCalc | 0a887ab53824994c7bf7c76a20bd20c7507545f9 | [
"MIT"
] | null | null | null | InputFunctions.py | medmatix/DataSciCalc | 0a887ab53824994c7bf7c76a20bd20c7507545f9 | [
"MIT"
] | 3 | 2018-09-17T16:41:49.000Z | 2018-11-12T20:52:56.000Z | InputFunctions.py | medmatix/DataSciCalc | 0a887ab53824994c7bf7c76a20bd20c7507545f9 | [
"MIT"
] | null | null | null | '''
Created on Sep 9, 2018
@author: david
'''
from bokeh.core.properties import field
class InputFunctions(object):
'''
Methods for directing input to list or unary float Variable
'''
def __init__(self, params):
'''
Constructor
'''
def getx(self):
'''
... | 17.37037 | 63 | 0.530917 |
66b419ed63533ad570776f628cb56d4aaada1f13 | 617 | py | Python | haas/ext/auth/null.py | matsuuran/hil | 27963f5f401e320b2da7409498b0220ea66b7e9c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | haas/ext/auth/null.py | matsuuran/hil | 27963f5f401e320b2da7409498b0220ea66b7e9c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | haas/ext/auth/null.py | matsuuran/hil | 27963f5f401e320b2da7409498b0220ea66b7e9c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """'Null' auth backend
This backend requires no authentication and permits everything. Useful for
testing, do not use in production."""
from haas import auth
import logging
from haas.rest import ContextLogger
logger = ContextLogger(logging.getLogger(__name__), {})
class NullAuthBackend(auth.AuthBackend):
def ... | 22.035714 | 74 | 0.727715 |
75a9c099cee61abb591ecc94474a41085ad5126e | 3,169 | py | Python | plenum/test/metrics/test_value_accumulator.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | 148 | 2017-07-11T19:05:25.000Z | 2022-03-16T21:31:20.000Z | plenum/test/metrics/test_value_accumulator.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | 561 | 2017-06-29T17:59:56.000Z | 2022-03-09T15:47:14.000Z | plenum/test/metrics/test_value_accumulator.py | andkononykhin/plenum | 28dc1719f4b7e80d31dafbadb38cfec4da949886 | [
"Apache-2.0"
] | 378 | 2017-06-29T17:45:27.000Z | 2022-03-26T07:27:59.000Z | import math
import statistics
import struct
from plenum.common.value_accumulator import ValueAccumulator
def test_value_accumulator_dont_return_anything_when_created():
acc = ValueAccumulator()
assert acc.count == 0
assert acc.sum == 0
assert acc.avg is None
assert acc.stddev is None
assert a... | 23.131387 | 72 | 0.671505 |
f396f10a045d4086b784f4e6ba29c266dc2c6f6e | 1,437 | py | Python | gromosparser/metainfo/__init__.py | nomad-coe/nomad-parser-gromos | 8af916388ded72133577542522dadcefd0db0620 | [
"Apache-2.0"
] | null | null | null | gromosparser/metainfo/__init__.py | nomad-coe/nomad-parser-gromos | 8af916388ded72133577542522dadcefd0db0620 | [
"Apache-2.0"
] | null | null | null | gromosparser/metainfo/__init__.py | nomad-coe/nomad-parser-gromos | 8af916388ded72133577542522dadcefd0db0620 | [
"Apache-2.0"
] | null | null | null | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... | 44.90625 | 120 | 0.797495 |
bb14418479adf84617054fdadc4d3bcb90d38886 | 1,617 | py | Python | src/lib/datasets/evaluation/IDDscripts/domain_adaptation/source/core/gta.py | KatiaJDL/CenterPoly | 42811d9f5f85d9fef91a03275fe6ad113ccb163c | [
"MIT"
] | null | null | null | src/lib/datasets/evaluation/IDDscripts/domain_adaptation/source/core/gta.py | KatiaJDL/CenterPoly | 42811d9f5f85d9fef91a03275fe6ad113ccb163c | [
"MIT"
] | null | null | null | src/lib/datasets/evaluation/IDDscripts/domain_adaptation/source/core/gta.py | KatiaJDL/CenterPoly | 42811d9f5f85d9fef91a03275fe6ad113ccb163c | [
"MIT"
] | null | null | null | from pathlib import Path
import pandas as pd
import argparse
from tqdm import tqdm
import shutil
import os
parser = argparse.ArgumentParser()
parser.add_argument("datadir",help="path to dataset")
parser.add_argument("savedir",help="path to save directory")
### test ###
dd = Path('/raid/datasets/SemanticSegmentation/d... | 29.4 | 96 | 0.666048 |
6300a1b3d6928ee2298861c69ebe7fd1baf0cc5a | 26 | py | Python | goatools/semsim/__init__.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 477 | 2015-02-10T06:54:42.000Z | 2022-03-15T12:36:11.000Z | goatools/semsim/__init__.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 174 | 2015-02-05T18:11:14.000Z | 2022-03-29T10:24:19.000Z | goatools/semsim/__init__.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 202 | 2015-01-21T12:29:23.000Z | 2022-03-01T13:26:05.000Z | """Semantic Similarity"""
| 13 | 25 | 0.692308 |
e1319b6146ebb3ed0fe7aae4884a2d80e85f17ef | 23,677 | py | Python | certbot/tests/auth_handler_test.py | Srinivas11789/certbot | 353d09258575a5a8bfcfe7cb145834f787f2b7bb | [
"Apache-2.0"
] | null | null | null | certbot/tests/auth_handler_test.py | Srinivas11789/certbot | 353d09258575a5a8bfcfe7cb145834f787f2b7bb | [
"Apache-2.0"
] | null | null | null | certbot/tests/auth_handler_test.py | Srinivas11789/certbot | 353d09258575a5a8bfcfe7cb145834f787f2b7bb | [
"Apache-2.0"
] | null | null | null | """Tests for certbot.auth_handler."""
import functools
import logging
import unittest
import mock
import six
import zope.component
from acme import challenges
from acme import client as acme_client
from acme import messages
from acme.magic_typing import Dict # pylint: disable=unused-import, no-name-in-module
from c... | 40.892919 | 100 | 0.68915 |
73d6a1525518f13cd7fe3eebb261f5f21086b04f | 6,937 | py | Python | SLMtools/read.py | adlhancock/SLMtools | ad4ad9efbadd37a68d9e48cbd7397124bdde3d2d | [
"MIT"
] | 1 | 2019-03-24T10:48:55.000Z | 2019-03-24T10:48:55.000Z | SLMtools/read.py | chrisheinze/SLMtools | ad4ad9efbadd37a68d9e48cbd7397124bdde3d2d | [
"MIT"
] | 1 | 2020-11-28T15:50:55.000Z | 2020-11-29T16:55:28.000Z | SLMtools/read.py | chrisheinze/SLMtools | ad4ad9efbadd37a68d9e48cbd7397124bdde3d2d | [
"MIT"
] | 1 | 2019-02-18T17:27:41.000Z | 2019-02-18T17:27:41.000Z | # -*- coding: utf-8 -*-
""" read.py
Created on Fri Mar 17 14:03:49 2017
@author: dhancock
"""
import tkinter as tk
from tkinter import filedialog
def xlsx_to_builds(importfile):
"""
imports a set of builds from a single excel file
Keyword Arguments:
- importfile: String with file path and nam... | 32.876777 | 101 | 0.554707 |
243f11d4c93ef07e479365a326d280065f38ddf6 | 1,501 | py | Python | responsibleai/setup.py | ShabadVaswani/responsible-ai-widgets | fdf5ac3a869fdeef24bb4964f3b0ee8111f26fec | [
"MIT"
] | 295 | 2021-01-31T23:25:21.000Z | 2021-11-29T07:34:22.000Z | responsibleai/setup.py | ShabadVaswani/responsible-ai-widgets | fdf5ac3a869fdeef24bb4964f3b0ee8111f26fec | [
"MIT"
] | 703 | 2021-01-30T23:42:58.000Z | 2021-11-30T14:41:23.000Z | responsibleai/setup.py | ShabadVaswani/responsible-ai-widgets | fdf5ac3a869fdeef24bb4964f3b0ee8111f26fec | [
"MIT"
] | 86 | 2021-02-01T15:52:57.000Z | 2021-11-29T04:34:22.000Z | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import os
import setuptools
# Version will be read from version.py
version = ''
name = 'responsibleai'
# Fetch Version
with open(os.path.join(name, '__version__.py')) as f:
code = compile(f.read(), f.name, 'exec')
exec(code)
# Fetch Read... | 29.431373 | 62 | 0.653564 |
8dfc0ee87c290ed056e9d33566543d36f0383f3b | 1,666 | py | Python | compute_ap.py | rhett-chen/graspnet-baseline | 825d1885e100e418b7a11590f18957270db09408 | [
"MIT"
] | 1 | 2021-04-20T14:49:23.000Z | 2021-04-20T14:49:23.000Z | compute_ap.py | rhett-chen/graspnet-baseline | 825d1885e100e418b7a11590f18957270db09408 | [
"MIT"
] | null | null | null | compute_ap.py | rhett-chen/graspnet-baseline | 825d1885e100e418b7a11590f18957270db09408 | [
"MIT"
] | null | null | null | import numpy as np
import os
ap_scenes_path = '/home/zibo/graspnet-baseline/logs/dump_rs/ap_scenes'
acc_all = []
for index in range(100, 190):
path = os.path.join(ap_scenes_path, str(index).zfill(4) + '.npy')
acc_c = np.load(path)
acc_all.append(acc_c)
acc_all = np.array(acc_all)
# 90 scenes * 256 images... | 29.75 | 98 | 0.647059 |
67af5abaa256e9e6f627dc69305d02c719c91d88 | 4,006 | py | Python | mis/tests/test_document.py | Egorka96/med-org-portal | 3f55fb59daea03684b3bc6b5c394cd06cfd6e2df | [
"MIT"
] | 2 | 2020-03-02T17:29:14.000Z | 2020-05-28T13:19:49.000Z | mis/tests/test_document.py | Egorka96/med-org-portal | 3f55fb59daea03684b3bc6b5c394cd06cfd6e2df | [
"MIT"
] | 88 | 2020-02-17T09:46:57.000Z | 2022-03-12T00:24:32.000Z | mis/tests/test_document.py | Egorka96/med-org-portal | 3f55fb59daea03684b3bc6b5c394cd06cfd6e2df | [
"MIT"
] | 1 | 2020-04-17T15:56:51.000Z | 2020-04-17T15:56:51.000Z | import datetime
from unittest import mock
from coverage.backunittest import TestCase
from django.test import override_settings
from kombu.utils import json
from mis.document import DocumentType, Document
from requests import Response
from project import settings
class DocumentTypeTests(TestCase):
MIS_URL = 'http... | 32.048 | 88 | 0.597354 |
7b73f696080d4ded13405582e62f5eadfdae1fd8 | 962 | py | Python | src/villains/models.py | reiniervdwindt/power-ranger-api | 13ce639a7f5e9d4b106ce5f094c076db0aad398e | [
"MIT"
] | null | null | null | src/villains/models.py | reiniervdwindt/power-ranger-api | 13ce639a7f5e9d4b106ce5f094c076db0aad398e | [
"MIT"
] | null | null | null | src/villains/models.py | reiniervdwindt/power-ranger-api | 13ce639a7f5e9d4b106ce5f094c076db0aad398e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.db.models import Q
from django.utils.encoding import python_2_unicode_compatible
from series.models import Series
from villains import constants
@python_2_unicode_compatible
class Villain(models.Model):
name = models.CharField(max_... | 35.62963 | 113 | 0.757796 |
d0a962bd7e3341936d72215443798fc315834500 | 53,814 | py | Python | tests/utils.py | olgapinheiro/batavia | 673705c14a8f64c000b52501a62f3db384bd5e03 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | olgapinheiro/batavia | 673705c14a8f64c000b52501a62f3db384bd5e03 | [
"BSD-3-Clause"
] | null | null | null | tests/utils.py | olgapinheiro/batavia | 673705c14a8f64c000b52501a62f3db384bd5e03 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import atexit
import base64
import contextlib
from io import StringIO
import importlib
import os
import py_compile
import re
import shutil
import sre_constants
import subprocess
import sys
import tempfile
import traceback
import itertools
import collections
from unittest import TestCase
# get ... | 35.334209 | 339 | 0.498439 |
432ba3079e1b110d4a817fed2973fad75c7f56e7 | 3,528 | py | Python | bracoDoDisco.py | joaomota59/algoritmosDoBracoDoDisco | 8e4697860a63d8c17b3d8a154479438ac9ff247c | [
"MIT"
] | null | null | null | bracoDoDisco.py | joaomota59/algoritmosDoBracoDoDisco | 8e4697860a63d8c17b3d8a154479438ac9ff247c | [
"MIT"
] | null | null | null | bracoDoDisco.py | joaomota59/algoritmosDoBracoDoDisco | 8e4697860a63d8c17b3d8a154479438ac9ff247c | [
"MIT"
] | null | null | null | from copy import deepcopy
import numpy as np
import sys
def firstComeFirstServed(passoApasso = False): #sempre pega o elemento da frente e subtrai com o anterior
soma = 0
if passoApasso:
print(matriz,"\n")
for i in range(1,len(matriz[1:])):
if passoApasso:
print("|"+str(matriz[i... | 33.923077 | 167 | 0.642574 |
20f7cf9ac345f874ebc321d1ba00b27095e5ba5b | 183 | py | Python | oddeven.py | SayantanD98/Python_Programs | d09855757ba680ea164e4bb4e3c81a21cf4f5d2b | [
"MIT"
] | null | null | null | oddeven.py | SayantanD98/Python_Programs | d09855757ba680ea164e4bb4e3c81a21cf4f5d2b | [
"MIT"
] | null | null | null | oddeven.py | SayantanD98/Python_Programs | d09855757ba680ea164e4bb4e3c81a21cf4f5d2b | [
"MIT"
] | null | null | null | # To determine whether the entered number is even or odd
num=input("Enter the Number : \n")
if (num%2==0):
print " Number is Even "
else:
print " Number is Odd. "
| 18.3 | 57 | 0.612022 |
b28a9885862a72e4c2703dfac1017963c5cf3bba | 413 | py | Python | Big Data Analytics Using Spark/Section2-Weather-PCA_PART1/lib/MultiPlot.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | null | null | null | Big Data Analytics Using Spark/Section2-Weather-PCA_PART1/lib/MultiPlot.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | null | null | null | Big Data Analytics Using Spark/Section2-Weather-PCA_PART1/lib/MultiPlot.py | kokuraxc/play-ground | 48b5291f3cca117e0cd0a17bf9255ec4dc1a5cdd | [
"MIT"
] | 2 | 2020-04-16T16:46:00.000Z | 2020-04-19T00:01:41.000Z | from matplotlib.pylab import subplots,axis
def plot_pair(pair,func):
"""
Create two side-by-side plots:
pair
"""
j=0
fig,X=subplots(1,2,figsize=(16,6))
axes=X.reshape(2)
for m in pair:
axis = axes[j]
j+=1
func(m,fig,axis)
def plot_single(element,func,filename):
... | 21.736842 | 42 | 0.610169 |
ac30822c92016ac59f0209b4c0c1eea8ee9bb450 | 3,093 | py | Python | gc_resource_calculator/resource_calculator.py | zynpsnltrk/google-cloud-calculator | 08025b1de98404f53f6492166dce3dc6afa82b49 | [
"MIT"
] | 3 | 2018-10-13T16:11:32.000Z | 2021-05-31T18:58:07.000Z | gc_resource_calculator/resource_calculator.py | zynpsnltrk/google-cloud-calculator | 08025b1de98404f53f6492166dce3dc6afa82b49 | [
"MIT"
] | null | null | null | gc_resource_calculator/resource_calculator.py | zynpsnltrk/google-cloud-calculator | 08025b1de98404f53f6492166dce3dc6afa82b49 | [
"MIT"
] | 1 | 2018-10-27T11:17:56.000Z | 2018-10-27T11:17:56.000Z | import argparse
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
class GCResourceCalculator(object):
instances = []
machine_types = []
def __init__(self, _project, zone):
self.compute = discovery.build('compute', 'v1')
self.credentials = GoogleCreden... | 42.369863 | 113 | 0.643388 |
ff95fbefee17860e67ae08aed6554a8cb3f2c59f | 50,671 | py | Python | abaverify/main.py | aFrankLion/abaverify | 2b49ef2ecb618094757032b778ee9d8832be5219 | [
"NASA-1.3"
] | 23 | 2016-10-18T12:44:28.000Z | 2022-01-31T16:03:13.000Z | abaverify/main.py | nasa/Abaverify | 2b49ef2ecb618094757032b778ee9d8832be5219 | [
"NASA-1.3"
] | 3 | 2018-07-02T16:41:38.000Z | 2019-04-24T20:11:14.000Z | abaverify/main.py | nasa/Abaverify | 2b49ef2ecb618094757032b778ee9d8832be5219 | [
"NASA-1.3"
] | 22 | 2017-01-19T19:35:16.000Z | 2022-01-10T10:58:11.000Z | """
This is the main API for the abaverify package.
"""
import unittest
from optparse import OptionParser
import sys
import platform
import os
import re
import shutil
import subprocess
import contextlib
import itertools as it
import time
import inspect
import getpass
import datetime
import pprint
from threading import ... | 44.448246 | 230 | 0.568451 |
8e1003a43f55c2e275e6e575b28d0dbe6ffd31dd | 754 | py | Python | Blog/Blog/urls.py | duyunj/secondRe | acacf235677f6e23743380735950ebc8f9936242 | [
"MIT"
] | null | null | null | Blog/Blog/urls.py | duyunj/secondRe | acacf235677f6e23743380735950ebc8f9936242 | [
"MIT"
] | null | null | null | Blog/Blog/urls.py | duyunj/secondRe | acacf235677f6e23743380735950ebc8f9936242 | [
"MIT"
] | null | null | null | """Blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | 34.272727 | 77 | 0.704244 |
6ef72ba2983b3bb48fb69cc9556263407c00a091 | 5,705 | py | Python | scripts/basic.py | planetmaker/pywikibot | acfa697250092f69bdd338057eccdc119f7d0fcf | [
"MIT"
] | null | null | null | scripts/basic.py | planetmaker/pywikibot | acfa697250092f69bdd338057eccdc119f7d0fcf | [
"MIT"
] | null | null | null | scripts/basic.py | planetmaker/pywikibot | acfa697250092f69bdd338057eccdc119f7d0fcf | [
"MIT"
] | 1 | 2020-04-14T14:52:24.000Z | 2020-04-14T14:52:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
An incomplete sample script.
This is not a complete bot; rather, it is a template from which simple
bots can be made. You can rename it to mybot.py, then edit it in
whatever way you want.
Use global -simulate option for test purposes. No changes to live wiki
will be done.... | 32.231638 | 78 | 0.637686 |
dc15f7afd64e0eb9a816fa6d966efaec42c50eba | 908 | py | Python | LeetCode/Session3/IntervalListIntersection.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/IntervalListIntersection.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | LeetCode/Session3/IntervalListIntersection.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def intervalIntersection(self, A: List[List[int]], B: List[List[int]]) -> List[List[int]]:
def isOverlap(start1, end1, start2, end2):
if end1 < start2 or end2 < start1:
return False
return True
if not A or not B:
... | 32.428571 | 94 | 0.490088 |
fc081b37934203d76df04375cf081284d77f52e6 | 4,743 | py | Python | decisionTree/decisionTree.py | hecate-xw/machineLearning | 5b48a0337d6e9a5ea05d9c16a2f63fba650a84ee | [
"MIT"
] | null | null | null | decisionTree/decisionTree.py | hecate-xw/machineLearning | 5b48a0337d6e9a5ea05d9c16a2f63fba650a84ee | [
"MIT"
] | 1 | 2016-11-13T17:23:15.000Z | 2016-12-01T14:29:29.000Z | decisionTree/decisionTree.py | hecate-xw/machineLearning | 5b48a0337d6e9a5ea05d9c16a2f63fba650a84ee | [
"MIT"
] | null | null | null | #!usr/bin/env python
#coding=utf-8
import math
import operator
def calculateShannonEnergy(dataSet): #Calculate Shannon Energy
numEntries = len(dataSet)
labelCounts = {}
for featureVector in dataSet:
currentLabel = featureVector[-1]
if currentLabel not in labelCounts.keys():
... | 44.327103 | 132 | 0.683323 |
d12bae794d8bf4a6b6f04e30501d97b280444477 | 3,804 | py | Python | StandardDataSets/collada/library_geometries/geometry/mesh/triangles/simple/simple.py | KhronosGroup/COLLADA-CTS | 61f2a560cbb2a06ee62da8025241f6b08d06bfd9 | [
"MIT"
] | 20 | 2015-03-19T08:02:57.000Z | 2020-10-16T15:16:11.000Z | StandardDataSets/collada/library_geometries/geometry/mesh/triangles/simple/simple.py | Acidburn0zzz/COLLADA-CTS | 39a36188cf8710bbc003df43ed70b965eb4386bd | [
"MIT"
] | 4 | 2017-04-19T18:42:05.000Z | 2017-06-17T03:03:28.000Z | StandardDataSets/collada/library_geometries/geometry/mesh/triangles/simple/simple.py | Acidburn0zzz/COLLADA-CTS | 39a36188cf8710bbc003df43ed70b965eb4386bd | [
"MIT"
] | 10 | 2015-03-26T02:52:24.000Z | 2022-02-24T08:43:48.000Z |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | 52.109589 | 467 | 0.722135 |
7e011d968cbd89d649ca179671e427332d27a2de | 1,978 | py | Python | config/providers.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | null | null | null | config/providers.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | 3 | 2018-07-25T17:36:43.000Z | 2020-01-06T18:52:51.000Z | config/providers.py | josephmancuso/gbaleague-masonite2 | b3dd5ec3f20c07eaabcc3129b0c50379a946a82b | [
"MIT"
] | null | null | null | """ Providers Configuration File """
from billing.providers import BillingProvider
# from dashboard.providers import DashboardProvider, UserManagementProvider
from masonite.providers import (AppProvider, BroadcastProvider, CacheProvider,
CsrfProvider, HelpersProvider, MailProvider,
... | 30.90625 | 78 | 0.647118 |
c2f2ac9c01f342546790a34a60856b788126caa9 | 40,277 | py | Python | akshare/futures/cot.py | lisong996/akshare | 1ee414cdecc2a492f2bb2f40d326a627c46dae2b | [
"MIT"
] | 4,202 | 2019-10-01T08:55:03.000Z | 2021-09-21T07:15:57.000Z | akshare/futures/cot.py | lisong996/akshare | 1ee414cdecc2a492f2bb2f40d326a627c46dae2b | [
"MIT"
] | 290 | 2019-11-21T06:23:30.000Z | 2021-09-21T08:29:02.000Z | akshare/futures/cot.py | lisong996/akshare | 1ee414cdecc2a492f2bb2f40d326a627c46dae2b | [
"MIT"
] | 894 | 2019-10-09T08:14:01.000Z | 2021-09-20T02:51:54.000Z | # -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
Date: 2021/1/12 15:06
Desc: 期货-中国-交易所-会员持仓数据接口
大连商品交易所、上海期货交易所、郑州商品交易所、中国金融期货交易所
采集前 20 会员持仓数据;
建议下午 16:30 以后采集当天数据, 避免交易所数据更新不稳定;
郑州商品交易所格式分为三类
大连商品交易所有具体合约的持仓排名, 通过 futures_dce_position_rank 获取
20171228
http://www.czce.com.cn/cn/DFSStaticFiles/Future/2020/20200727/Futu... | 49.909542 | 422 | 0.557241 |
8cb7d5e94f2b17ffabdf75f5758e3fec0960acc5 | 6,592 | py | Python | main.py | InhoStudios/Dentaku | 80d9974f6d9d8b9a2b5c6c8d687077526fcb0a08 | [
"MIT"
] | null | null | null | main.py | InhoStudios/Dentaku | 80d9974f6d9d8b9a2b5c6c8d687077526fcb0a08 | [
"MIT"
] | null | null | null | main.py | InhoStudios/Dentaku | 80d9974f6d9d8b9a2b5c6c8d687077526fcb0a08 | [
"MIT"
] | null | null | null | import json
import sys
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
from fbchat import log, Client
import os
from fbchat import Message
from fbchat.models import *
import traceback
from datetime import datetime
import time
from fbchat import ThreadType
from fbchat im... | 37.885057 | 106 | 0.52139 |
7a243449d0c0cb85314daa1d5f93b4debc0d93b7 | 5,259 | py | Python | src/bin/train.py | sas91/-jhu-neural-wpe | 597fbc6ff6a1edf8aa75a974b455679631e8af10 | [
"Apache-2.0"
] | 30 | 2019-03-29T15:02:12.000Z | 2022-02-12T14:34:45.000Z | src/bin/train.py | sas91/-jhu-neural-wpe | 597fbc6ff6a1edf8aa75a974b455679631e8af10 | [
"Apache-2.0"
] | 1 | 2019-05-20T05:44:02.000Z | 2019-05-22T05:42:12.000Z | src/bin/train.py | sas91/-jhu-neural-wpe | 597fbc6ff6a1edf8aa75a974b455679631e8af10 | [
"Apache-2.0"
] | 15 | 2019-03-17T12:28:07.000Z | 2021-06-14T16:01:53.000Z | #!/usr/bin/env python
# 2018 JHU CLSP (Aswin Shanmugam Subramanian)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import argparse
import logging
import os
import numpy as np
import chainer
from chainer import Variable
from chainer import cuda
from chainer import optimizers
from chainer import serialize... | 35.295302 | 87 | 0.616467 |
ce99b29b1c5c44b53d268906ac211df98f6657bb | 3,591 | py | Python | profiles_project/settings.py | mightnent/profiles_rest_api | a3545218d88cdf896d9593c2c0ad4813d1084f5a | [
"MIT"
] | null | null | null | profiles_project/settings.py | mightnent/profiles_rest_api | a3545218d88cdf896d9593c2c0ad4813d1084f5a | [
"MIT"
] | 8 | 2019-12-05T00:28:40.000Z | 2022-02-10T11:32:08.000Z | profiles_project/settings.py | mightnent/profiles_rest_api | a3545218d88cdf896d9593c2c0ad4813d1084f5a | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 27.412214 | 94 | 0.705375 |
0e4fde9eb8cf635ed44343115a724fa80ce0e862 | 257 | py | Python | roadpin_backend/app/crawler/new_taipei_city/new_taipei_city/pipelines.py | g0v/roadpin | c2919552dd3ce0e3614a35466bae6d6a740e9368 | [
"CC-BY-3.0",
"Apache-2.0"
] | 5 | 2015-04-20T17:16:56.000Z | 2018-12-25T11:14:22.000Z | roadpin_backend/app/crawler/new_taipei_city/new_taipei_city/pipelines.py | g0v/roadpin | c2919552dd3ce0e3614a35466bae6d6a740e9368 | [
"CC-BY-3.0",
"Apache-2.0"
] | 1 | 2016-06-20T02:55:27.000Z | 2016-06-21T15:37:19.000Z | roadpin_backend/app/crawler/new_taipei_city/new_taipei_city/pipelines.py | g0v/roadpin | c2919552dd3ce0e3614a35466bae6d6a740e9368 | [
"CC-BY-3.0",
"Apache-2.0"
] | null | null | null | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/topics/item-pipeline.html
class NewTaipeiCityPipeline(object):
def process_item(self, item, spider):
return item
| 28.555556 | 65 | 0.747082 |
d2a5be9d4afb16bac9b37e8f12198ae988c796a6 | 937 | py | Python | alipay/aop/api/domain/AlipayUserCertifyOpenCertifyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertifyOpenCertifyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayUserCertifyOpenCertifyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserCertifyOpenCertifyModel(object):
def __init__(self):
self._certify_id = None
@property
def certify_id(self):
return self._certify_id
@certify... | 22.853659 | 71 | 0.611526 |
cd110b55bc5e4756cecc9a069b7c4c573550436c | 3,906 | py | Python | pytouch/models/pix2pix/pix2pix.py | facebookresearch/PyTouch | 4619d86c030f8064229569e70b97bb7be4024563 | [
"MIT"
] | 149 | 2021-05-28T04:51:16.000Z | 2022-03-29T06:24:13.000Z | pytouch/models/pix2pix/pix2pix.py | hercules261188/PyTouch | 4619d86c030f8064229569e70b97bb7be4024563 | [
"MIT"
] | 8 | 2021-05-28T04:56:14.000Z | 2022-03-29T05:46:46.000Z | pytouch/models/pix2pix/pix2pix.py | hercules261188/PyTouch | 4619d86c030f8064229569e70b97bb7be4024563 | [
"MIT"
] | 20 | 2021-05-28T09:25:19.000Z | 2022-03-30T13:28:11.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from dataclasses import dataclass, field
from typing import List
import numpy as np
import torch
from PIL import Image
from pytouch.models.pix2pix.thirdparty.pix2pix.data.base_dataset import (
get_params,
get_transform,
)
from pytouch.mo... | 30.046154 | 88 | 0.646441 |
d1128e0cbba3b903874ad6876b23cd1c545f4bd2 | 12,601 | py | Python | cirq-google/cirq_google/engine/virtual_engine_factory.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/engine/virtual_engine_factory.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/engine/virtual_engine_factory.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 43.602076 | 98 | 0.744227 |
e0baba347c9f4a1788579b61dfbee3b9285d88e5 | 6,017 | py | Python | tests/scripts/thread-cert/Cert_5_5_04_SplitMergeRouters.py | BLUEGRioT/openthread | 04a6a9b925db13a52790cc1b12cb2d854f222799 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T06:15:53.000Z | 2020-08-12T06:15:53.000Z | tests/scripts/thread-cert/Cert_5_5_04_SplitMergeRouters.py | soburi/openthread | 34ac7c751a655caff5e2cdd5bb694d8f7735221d | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_5_5_04_SplitMergeRouters.py | soburi/openthread | 34ac7c751a655caff5e2cdd5bb694d8f7735221d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 37.60625 | 139 | 0.655642 |
79369d96bc10b34e5da4762babcea13e18155395 | 3,886 | py | Python | convex_contracts/contracts/did_registry_contract.py | datacraft-dsc/convex-contracts | 16dd54a5ad83bfb261ba4cedd100767593427e56 | [
"Apache-2.0"
] | 1 | 2020-10-19T10:06:52.000Z | 2020-10-19T10:06:52.000Z | convex_contracts/contracts/did_registry_contract.py | DEX-Company/convex-contracts | a323839813e7b4a31a927e63821a1c816c36beae | [
"Apache-2.0"
] | null | null | null | convex_contracts/contracts/did_registry_contract.py | DEX-Company/convex-contracts | a323839813e7b4a31a927e63821a1c816c36beae | [
"Apache-2.0"
] | null | null | null | """
starfish.did contract
(import convex.trust :as trust)
(trust/trusted? owner *caller*)
"""
from convex_contracts.convex_contract import ConvexContract
class DIDRegistryContract(ConvexContract):
def __init__(self, convex, name=None):
ConvexContract.__init__(self, convex, name or 'starfish.did', ... | 31.593496 | 128 | 0.405044 |
47460f9c888fee98ec30ed71112e8fa3c357340a | 1,663 | py | Python | oo/pessoa.py | brdam/pythonbirds | 1582636b0a5208443d5cedae26b024f8658fabca | [
"MIT"
] | null | null | null | oo/pessoa.py | brdam/pythonbirds | 1582636b0a5208443d5cedae26b024f8658fabca | [
"MIT"
] | null | null | null | oo/pessoa.py | brdam/pythonbirds | 1582636b0a5208443d5cedae26b024f8658fabca | [
"MIT"
] | null | null | null | class Pessoa:
olhos = 2
def __init__(self, *filhos, nome = None, idade = 35):
self.idade = idade
self.nome = nome
self.filhos = list(filhos)
def cumprimentar(self):
return f'Olá, meu nome é {self.nome}'
@staticmethod
def metodo_estatitco():
return 41+1
... | 28.186441 | 86 | 0.667468 |
5cbf3d26adae31da2da80e16d77f4280d6ddf96e | 528 | py | Python | model.py | twhtanghk/priceLSTM | da7dac5dca6fadb83b238ae1fdde794091edcc9c | [
"MIT"
] | null | null | null | model.py | twhtanghk/priceLSTM | da7dac5dca6fadb83b238ae1fdde794091edcc9c | [
"MIT"
] | null | null | null | model.py | twhtanghk/priceLSTM | da7dac5dca6fadb83b238ae1fdde794091edcc9c | [
"MIT"
] | null | null | null | # python model.py data.csv model.h5
import sys
from data import input, scaler, normalize
from env import look_back
close = input(sys.argv[1])
close = scaler.fit_transform(close)
X, Y = normalize(close, look_back)
from keras.models import Sequential, load_model
from keras.layers import Dense, LSTM
model = Sequential()... | 27.789474 | 58 | 0.75947 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.