hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f704356f4fb720f2bf93b959c1a2be1943a0b37d | 2,002 | py | Python | examples/devel/importing.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | 2 | 2019-05-23T22:17:29.000Z | 2020-07-03T14:36:22.000Z | examples/devel/importing.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | null | null | null | examples/devel/importing.py | markdoerr/pymol-open-source | b891b59ffaea812600648aa131ea2dbecd59a199 | [
"CNRI-Python"
] | null | null | null | # This is an example of firing up PyMOL inside of a subordinate
# process via an "import pymol"
#
# NOTE: for this to work, PyMOL must be installed in a
# Python-dependent fashion (e.g. pymol-0_98-bin-win32-py23) etc.
#
# WARNING: stability issues have been known to occur with this
# approach, so anticipate problems..... | 24.414634 | 77 | 0.67982 |
import string
import __main__
__main__.pymol_argv= string.split("pymol -qxiF -X 300 -Y 100 -H 400 -W 400")
import pymol
import time
time.sleep(1)
if 1:
pymol.cmd.set("sweep_mode",3)
pymol.cmd.rock()
pymol.cmd.turn("x",180)
pymol.cmd.load("$TUT/1hpv.pdb")
pymol.preset.pretty("1... | true | true |
f70435e6588b6eff0658bd07e3715657ae154bef | 387 | py | Python | algorithms/recursion/sum_of_sequence.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | algorithms/recursion/sum_of_sequence.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | algorithms/recursion/sum_of_sequence.py | zhijunsheng/tictactoe-py | 648bed3bbf56d441805d472c73b7951b73469f20 | [
"MIT"
] | null | null | null | import unittest
def linear_sum(S, n):
"""Return the sum of the first n numbers of sequence S."""
if n == 0:
return 0
else:
return linear_sum(S, n - 1) + S[n - 1]
class TestLinearSum(unittest.TestCase):
def test_linear_sum(self):
S = [4, 3, 6, 2, 8]
self.assertEqual(23,... | 21.5 | 62 | 0.589147 | import unittest
def linear_sum(S, n):
if n == 0:
return 0
else:
return linear_sum(S, n - 1) + S[n - 1]
class TestLinearSum(unittest.TestCase):
def test_linear_sum(self):
S = [4, 3, 6, 2, 8]
self.assertEqual(23, linear_sum(S, 5))
if __name__ == '__main__':
unittest.mai... | true | true |
f704376b4a39e532d7296da675a5c7c10f97297a | 593 | py | Python | polls/urls.py | FrankCasanova/poll-django | 4df8889d2802cd211a993d5de43f663cd6ef9a30 | [
"MIT"
] | null | null | null | polls/urls.py | FrankCasanova/poll-django | 4df8889d2802cd211a993d5de43f663cd6ef9a30 | [
"MIT"
] | null | null | null | polls/urls.py | FrankCasanova/poll-django | 4df8889d2802cd211a993d5de43f663cd6ef9a30 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
#here are our app-connections.(these connection just affect to our app, not at entire system)
#each connection going us to a view functionality
#these connections needs to be connect with url root, because that's where the requests come from
app_name = 'polls'
urlpat... | 34.882353 | 97 | 0.70489 | from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
path('<int:pk>/result/', views.ResultView.as_view(), name='result'),
path('<int:question_id>/vote/',... | true | true |
f70438d8f78b8f084550f654f4578c7326e7838c | 2,120 | py | Python | classes/menu.py | howard-2718/untitled_rpg | 49654afbfb548676df5d72d35e47b9e06eefa7a7 | [
"MIT"
] | null | null | null | classes/menu.py | howard-2718/untitled_rpg | 49654afbfb548676df5d72d35e47b9e06eefa7a7 | [
"MIT"
] | null | null | null | classes/menu.py | howard-2718/untitled_rpg | 49654afbfb548676df5d72d35e47b9e06eefa7a7 | [
"MIT"
] | null | null | null | """
Menu handling file
- Every menu is of the Menu class
- Menus are initialized with an array of options
- What a menu option does is determined by the following table:
- "set_state_map": s.set_state('map')
- "exit": exit()
"""
from config import *
import sys
class Menu:
def __init__(self, options, sel_inde... | 26.17284 | 71 | 0.556132 |
from config import *
import sys
class Menu:
def __init__(self, options, sel_index, results):
self.options = options
self.results = results
self._sel_index = sel_index
self.first_print = True
@property
def sel_index(self):
return self._sel_index
@sel_inde... | true | true |
f70439ea5e1c811be29ccac4a2c1991c2f496ec6 | 128,492 | py | Python | third_party/ply/ply/yacc.py | albertobarri/idk | a250884f79e2a484251fc750bb915ecbc962be58 | [
"MIT"
] | 9,724 | 2015-01-01T02:06:30.000Z | 2019-01-17T15:13:51.000Z | third_party/ply/yacc.py | 1065672644894730302/Chromium | 239dd49e906be4909e293d8991e998c9816eaa35 | [
"BSD-3-Clause"
] | 7,584 | 2019-01-17T22:58:27.000Z | 2022-03-31T23:10:22.000Z | third_party/ply/yacc.py | 1065672644894730302/Chromium | 239dd49e906be4909e293d8991e998c9816eaa35 | [
"BSD-3-Clause"
] | 1,519 | 2015-01-01T18:11:12.000Z | 2019-01-17T14:16:02.000Z | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2011,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 39.210253 | 176 | 0.470948 |
# Spark and the GNU bison utility.
#
# The current implementation is only somewhat object-oriented. The
# LR parser itself is defined in terms of an object (which allows multiple
# parsers to co-exist). However, most of the variables used during table
# construction are defined in ... | true | true |
f7043a393c4a30b5d5056296579c11f81244b7d0 | 150 | py | Python | common/enums/game_scenes.py | nikolastojsin/donkey-kong-drs-projekat | f7f837a7195aa731badb25d280c06317e9ada7d1 | [
"MIT"
] | null | null | null | common/enums/game_scenes.py | nikolastojsin/donkey-kong-drs-projekat | f7f837a7195aa731badb25d280c06317e9ada7d1 | [
"MIT"
] | null | null | null | common/enums/game_scenes.py | nikolastojsin/donkey-kong-drs-projekat | f7f837a7195aa731badb25d280c06317e9ada7d1 | [
"MIT"
] | null | null | null | from enum import Enum
class GameScenes(Enum):
FIRST_LEVEL = 1
SECOND_LEVEL = 2
THIRD_LEVEL = 3
FOURTH_LEVEL = 4
FIFTH_LEVEL = 5
| 15 | 23 | 0.66 | from enum import Enum
class GameScenes(Enum):
FIRST_LEVEL = 1
SECOND_LEVEL = 2
THIRD_LEVEL = 3
FOURTH_LEVEL = 4
FIFTH_LEVEL = 5
| true | true |
f7043a4617de8a54b3d6ff2a89444c0826f42479 | 94 | py | Python | web/apps/login/app.py | JW709/zoom | 3b26a22e569bf44a9856b587771589413b52e81b | [
"MIT"
] | 1 | 2017-05-11T17:24:49.000Z | 2017-05-11T17:24:49.000Z | web/apps/login/app.py | sean-hayes/zoom | eda69c64ceb69dd87d2f7a5dfdaeea52ef65c581 | [
"MIT"
] | null | null | null | web/apps/login/app.py | sean-hayes/zoom | eda69c64ceb69dd87d2f7a5dfdaeea52ef65c581 | [
"MIT"
] | 1 | 2020-07-20T00:33:27.000Z | 2020-07-20T00:33:27.000Z | """
login app
"""
from zoom.apps import App
class MyApp(App):
pass
app = MyApp()
| 7.230769 | 25 | 0.574468 |
from zoom.apps import App
class MyApp(App):
pass
app = MyApp()
| true | true |
f7043a58b466f3f8e7c9d564fe527c55e1f9d6fe | 825 | py | Python | cohere-scripts/beamlines/aps_34idc/diffractometers.py | jacione/cohere-scripts | 6bb111035660a57e18da5d86ad9dbf0f1d50c657 | [
"BSD-3-Clause"
] | null | null | null | cohere-scripts/beamlines/aps_34idc/diffractometers.py | jacione/cohere-scripts | 6bb111035660a57e18da5d86ad9dbf0f1d50c657 | [
"BSD-3-Clause"
] | null | null | null | cohere-scripts/beamlines/aps_34idc/diffractometers.py | jacione/cohere-scripts | 6bb111035660a57e18da5d86ad9dbf0f1d50c657 | [
"BSD-3-Clause"
] | null | null | null | from cohere import Diffractometer
class Diffractometer_34idc(Diffractometer):
"""
Subclass of Diffractometer. Encapsulates "34idc" diffractometer.
"""
name = "34idc"
sampleaxes = ('y+', 'z-', 'y+') # in xrayutilities notation
detectoraxes = ('y+', 'x-')
incidentaxis = (0, 0, 1)
sample... | 25 | 83 | 0.637576 | from cohere import Diffractometer
class Diffractometer_34idc(Diffractometer):
name = "34idc"
sampleaxes = ('y+', 'z-', 'y+')
detectoraxes = ('y+', 'x-')
incidentaxis = (0, 0, 1)
sampleaxes_name = ('th', 'chi', 'phi')
detectoraxes_name = ('delta', 'gamma')
def __init__(self):
s... | true | true |
f7043af4f416dadb6f4555672f0616879e32a468 | 1,479 | py | Python | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/CheckDomainSunriseClaimRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/CheckDomainSunriseClaimRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-domain/aliyunsdkdomain/request/v20180129/CheckDomainSunriseClaimRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"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.214286 | 79 | 0.765382 |
from aliyunsdkcore.request import RpcRequest
class CheckDomainSunriseClaimRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Domain', '2018-01-29', 'CheckDomainSunriseClaim')
def get_DomainName(self):
return self.get_query_params().get('DomainName')
def set_DomainName(... | true | true |
f7043b12ee54ca5fb24b861efb48efdd876d80e1 | 1,484 | py | Python | Boilermake2018/Lib/site-packages/chatterbot/preprocessors.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 9 | 2021-08-08T22:42:55.000Z | 2021-11-23T06:50:30.000Z | Boilermake2018/Lib/site-packages/chatterbot/preprocessors.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 2 | 2017-12-06T07:40:08.000Z | 2017-12-06T07:42:43.000Z | Boilermake2018/Lib/site-packages/chatterbot/preprocessors.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 7 | 2018-01-04T10:02:11.000Z | 2019-06-18T14:24:04.000Z | # -*- coding: utf-8 -*-
"""
Statement pre-processors.
"""
def clean_whitespace(chatbot, statement):
"""
Remove any consecutive whitespace characters from the statement text.
"""
import re
# Replace linebreaks and tabs with spaces
statement.text = statement.text.replace('\n', ' ').replace('\r'... | 24.327869 | 92 | 0.654987 |
def clean_whitespace(chatbot, statement):
import re
statement.text = statement.text.replace('\n', ' ').replace('\r', ' ').replace('\t', ' ')
statement.text = statement.text.strip()
statement.text = re.sub(' +', ' ', statement.text)
return statement
def unescape_html(chatbot, ... | true | true |
f7043b3ecfc447c28853664acd21eddc6920523e | 5,304 | py | Python | NREL/custom/packages/nalu-wind/package.py | jfinney10/spack-configs | c230ade92794901eb3563dfc9a0e1ec370b6a27a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 36 | 2018-07-31T20:35:13.000Z | 2022-03-27T16:48:17.000Z | NREL/custom/packages/nalu-wind/package.py | jfinney10/spack-configs | c230ade92794901eb3563dfc9a0e1ec370b6a27a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2018-08-08T16:25:34.000Z | 2022-03-11T20:54:27.000Z | NREL/custom/packages/nalu-wind/package.py | jfinney10/spack-configs | c230ade92794901eb3563dfc9a0e1ec370b6a27a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2018-07-31T20:47:10.000Z | 2021-12-17T21:21:59.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import sys
class NaluWind(CMakePackage):
"""Nalu-Wind: Wind energy focused variant of Nalu."""
... | 37.352113 | 178 | 0.601621 |
from spack import *
import sys
class NaluWind(CMakePackage):
homepage = "https://github.com/exawind/nalu-wind"
git = "https://github.com/exawind/nalu-wind.git"
maintainers = ['jrood-nrel']
tags = ['ecp', 'ecp-apps']
version('master', branch='master')
variant('shared', defau... | true | true |
f7043bacf01e5c86f3a51de97e89c88870e9d8c2 | 202 | py | Python | Kattis/ostgotska.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | null | null | null | Kattis/ostgotska.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | null | null | null | Kattis/ostgotska.py | ruidazeng/online-judge | 6bdf8bbf1af885637dab474d0ccb58aff22a0933 | [
"MIT"
] | 1 | 2020-06-22T21:07:24.000Z | 2020-06-22T21:07:24.000Z | sentence = input().split()
ae = 0
for word in sentence:
if 'ae' in word:
ae += 1
if ae/len(sentence) >= 0.4:
print("dae ae ju traeligt va")
else:
print("haer talar vi rikssvenska") | 18.363636 | 38 | 0.59901 | sentence = input().split()
ae = 0
for word in sentence:
if 'ae' in word:
ae += 1
if ae/len(sentence) >= 0.4:
print("dae ae ju traeligt va")
else:
print("haer talar vi rikssvenska") | true | true |
f7043cb19891a8f93b1476ce2dcbdead32e526d8 | 117,170 | py | Python | env/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 168 | 2015-05-29T13:56:01.000Z | 2022-02-17T07:38:17.000Z | env/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 3,243 | 2017-02-07T15:30:01.000Z | 2022-03-31T16:42:19.000Z | env/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass, viewkeys, PY3
import types
try:
from collections import OrderedDict
except ImportError:
from pip._vendor.ordereddict import OrderedDict
from . import _inputstream
from . import _tokenizer
from . im... | 42.85662 | 116 | 0.547546 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass, viewkeys, PY3
import types
try:
from collections import OrderedDict
except ImportError:
from pip._vendor.ordereddict import OrderedDict
from . import _inputstream
from . import _tokenizer
from . im... | true | true |
f7043ccf5a72a6b1cf26416838a2233e35f68a0c | 732 | py | Python | doc/_ext/rst_roles.py | CarsonSlovoka/image-rename | 6ff64647aa893ee5c23bfd7e8cc452a7a7d32f29 | [
"BSD-3-Clause"
] | 2 | 2020-07-03T12:56:17.000Z | 2021-07-07T16:56:12.000Z | doc/_ext/rst_roles.py | CarsonSlovoka/image-rename | 6ff64647aa893ee5c23bfd7e8cc452a7a7d32f29 | [
"BSD-3-Clause"
] | null | null | null | doc/_ext/rst_roles.py | CarsonSlovoka/image-rename | 6ff64647aa893ee5c23bfd7e8cc452a7a7d32f29 | [
"BSD-3-Clause"
] | null | null | null | from docutils.parsers.rst import roles
from docutils import nodes
from docutils.parsers.rst.states import Inliner
import docutils.parsers.rst.roles
def strike_role(role, rawtext, text, lineno, inliner: Inliner, options={}, content=[]):
"""
USAGE: :del:`your context`
:param role: my-strike
:param raw... | 24.4 | 87 | 0.670765 | from docutils.parsers.rst import roles
from docutils import nodes
from docutils.parsers.rst.states import Inliner
import docutils.parsers.rst.roles
def strike_role(role, rawtext, text, lineno, inliner: Inliner, options={}, content=[]):
node = nodes.inline(rawtext, text, **dict(classes=['strike']))
... | true | true |
f7043dd4a34f458d08244ea0a3dea781fe8dba49 | 24 | py | Python | python_code.py | vervainalthor/Coursera-Capstone | b6a5e4ec2c62cba0b212709c9d8d8d8ee3f6b12f | [
"MIT"
] | null | null | null | python_code.py | vervainalthor/Coursera-Capstone | b6a5e4ec2c62cba0b212709c9d8d8d8ee3f6b12f | [
"MIT"
] | 1 | 2021-03-31T19:41:58.000Z | 2021-03-31T19:41:58.000Z | python_code.py | vervainalthor/Coursera-Capstone | b6a5e4ec2c62cba0b212709c9d8d8d8ee3f6b12f | [
"MIT"
] | 16 | 2020-04-13T21:15:59.000Z | 2021-07-11T12:13:57.000Z | print("Hello Github!")
| 8 | 22 | 0.666667 | print("Hello Github!")
| true | true |
f7043e99aff18d59102db1415aebe0995652b748 | 681 | py | Python | plagiarismChecker.py | saurabhkumar29/website | 41bb1c2850727dcf1a2a8d8664140a6951718ea6 | [
"CC-BY-3.0"
] | null | null | null | plagiarismChecker.py | saurabhkumar29/website | 41bb1c2850727dcf1a2a8d8664140a6951718ea6 | [
"CC-BY-3.0"
] | null | null | null | plagiarismChecker.py | saurabhkumar29/website | 41bb1c2850727dcf1a2a8d8664140a6951718ea6 | [
"CC-BY-3.0"
] | null | null | null | # Author: Khalid - naam toh suna hi hoga
# Steps to run ->
# :~$ python yoyo.py
from flask import Flask
from flask import request
from flask import render_template
import stringComparison
app = Flask(__name__)
@app.route('/')
def my_form():
return render_template("my-form.html")
@app.route('/', methods=['POST'])... | 24.321429 | 86 | 0.687225 |
from flask import Flask
from flask import request
from flask import render_template
import stringComparison
app = Flask(__name__)
@app.route('/')
def my_form():
return render_template("my-form.html")
@app.route('/', methods=['POST'])
def my_form_post():
text1 = request.form['text1']
text2 = request.f... | true | true |
f7043f749d59fc0929d6d9c0de4e74f7310101fa | 32,980 | py | Python | tests/test_pysnooper.py | leozhoujf/Pyasnooper | 43bde4b8bf730b4782d8897b601a5925f6621f37 | [
"MIT"
] | null | null | null | tests/test_pysnooper.py | leozhoujf/Pyasnooper | 43bde4b8bf730b4782d8897b601a5925f6621f37 | [
"MIT"
] | null | null | null | tests/test_pysnooper.py | leozhoujf/Pyasnooper | 43bde4b8bf730b4782d8897b601a5925f6621f37 | [
"MIT"
] | null | null | null | # Copyright 2019 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
import io
import textwrap
import threading
import types
import sys
from pysnooper.utils import truncate
from python_toolbox import sys_tools, temp_file_tools
import pytest
import pysnooper
from pysnooper.variables imp... | 28.068085 | 79 | 0.503062 |
import io
import textwrap
import threading
import types
import sys
from pysnooper.utils import truncate
from python_toolbox import sys_tools, temp_file_tools
import pytest
import pysnooper
from pysnooper.variables import needs_parentheses
from .utils import (assert_output, assert_sample_output, VariableEntry,
... | true | true |
f7043fdb3cb677c8bc7f76a02ec8ae40c8f1cd3f | 3,005 | py | Python | tests/templates/test_templates.py | lhenkelm/cabinetry | 40120c2718502cd69c8486020de963bde9005989 | [
"BSD-3-Clause"
] | 13 | 2020-04-30T04:23:06.000Z | 2021-09-06T20:26:31.000Z | tests/templates/test_templates.py | alexander-held/pytfc | fce72088b4a6345304bf8c2e489938d41087a253 | [
"BSD-3-Clause"
] | 247 | 2020-05-07T00:26:02.000Z | 2021-09-17T14:24:43.000Z | tests/templates/test_templates.py | alexander-held/pytfc | fce72088b4a6345304bf8c2e489938d41087a253 | [
"BSD-3-Clause"
] | 6 | 2020-05-07T00:11:27.000Z | 2021-03-11T18:26:07.000Z | import logging
import pathlib
from unittest import mock
from cabinetry import templates
@mock.patch("cabinetry.route.apply_to_all_templates")
@mock.patch("cabinetry.templates.builder._Builder")
def test_build(mock_builder, mock_apply):
config = {"General": {"HistogramFolder": "path/", "InputPath": "file.root"}}
... | 34.147727 | 86 | 0.678203 | import logging
import pathlib
from unittest import mock
from cabinetry import templates
@mock.patch("cabinetry.route.apply_to_all_templates")
@mock.patch("cabinetry.templates.builder._Builder")
def test_build(mock_builder, mock_apply):
config = {"General": {"HistogramFolder": "path/", "InputPath": "file.root"}}
... | true | true |
f7044003f4f588cd91a481166091139275273f80 | 6,801 | py | Python | app/chaosblade/chaosblade.py | baiyanquan/k8sTools | 882a30f2a19dffb0900efd5be61826400080a6ef | [
"Apache-2.0"
] | null | null | null | app/chaosblade/chaosblade.py | baiyanquan/k8sTools | 882a30f2a19dffb0900efd5be61826400080a6ef | [
"Apache-2.0"
] | 1 | 2019-12-18T12:23:34.000Z | 2019-12-18T12:23:34.000Z | app/chaosblade/chaosblade.py | baiyanquan/k8sTools | 882a30f2a19dffb0900efd5be61826400080a6ef | [
"Apache-2.0"
] | 3 | 2019-10-09T06:23:39.000Z | 2019-10-20T02:39:14.000Z | from flask import Blueprint, jsonify
from flask import request
from flask import abort
from services.fault_injector import FaultInjector
from apscheduler.schedulers.background import BackgroundScheduler
from datetime import datetime, timedelta
import time
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ser... | 34.175879 | 120 | 0.6774 | from flask import Blueprint, jsonify
from flask import request
from flask import abort
from services.fault_injector import FaultInjector
from apscheduler.schedulers.background import BackgroundScheduler
from datetime import datetime, timedelta
import time
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ser... | false | true |
f70440dd09341f241e10da230ab174b5743ee8df | 11,582 | py | Python | MecademicRobot/RobotFeedback.py | GarrisonJohnston123/meca500_python2_driver | a5b9be9362dba3612b902cc5dfee5553d1a895cd | [
"MIT"
] | null | null | null | MecademicRobot/RobotFeedback.py | GarrisonJohnston123/meca500_python2_driver | a5b9be9362dba3612b902cc5dfee5553d1a895cd | [
"MIT"
] | null | null | null | MecademicRobot/RobotFeedback.py | GarrisonJohnston123/meca500_python2_driver | a5b9be9362dba3612b902cc5dfee5553d1a895cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import socket
import re
class RobotFeedback:
"""Class for the Mecademic Robot allowing for live positional
feedback of the Mecademic Robot.
Attributes
----------
address : string
The IP address associated to the Mecademic robot.
socket : socket
Socket con... | 35.310976 | 135 | 0.567864 |
import socket
import re
class RobotFeedback:
def __init__(self, address, firmware_version):
self.address = address
self.socket = None
self.robot_status = ()
self.gripper_status = ()
self.joints = ()
self.cartesian = ()
self.joints_vel =()
self.to... | true | true |
f7044144ec2809f9d7962b59fb909c9753171af5 | 19,423 | py | Python | tests/model_inheritance_regress/tests.py | indevgr/django | 0247c9b08f8da4a2d93b9cede6c615011552b55a | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-01-11T06:27:15.000Z | 2017-01-11T06:27:15.000Z | tests/model_inheritance_regress/tests.py | indevgr/django | 0247c9b08f8da4a2d93b9cede6c615011552b55a | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/model_inheritance_regress/tests.py | indevgr/django | 0247c9b08f8da4a2d93b9cede6c615011552b55a | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2019-10-22T12:16:53.000Z | 2019-10-22T12:16:53.000Z | """
Regression tests for Model inheritance behavior.
"""
from __future__ import unicode_literals
import datetime
from operator import attrgetter
from unittest import expectedFailure
from django import forms
from django.test import TestCase
from .models import (
ArticleWithAuthor, BachelorParty, BirthdayParty, Bu... | 38.159136 | 91 | 0.622973 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from unittest import expectedFailure
from django import forms
from django.test import TestCase
from .models import (
ArticleWithAuthor, BachelorParty, BirthdayParty, BusStation, Child,
DerivedM, InternalCertificationAudit... | true | true |
f704431757b191fd6a6405e1724d23679ca1b2f0 | 1,173 | py | Python | script/app/agg.py | Intelligent-Systems-Lab/ISL-BCFL | 42ceb86708a76e28b31c22b33c15ee9a6a745ec7 | [
"Apache-2.0"
] | null | null | null | script/app/agg.py | Intelligent-Systems-Lab/ISL-BCFL | 42ceb86708a76e28b31c22b33c15ee9a6a745ec7 | [
"Apache-2.0"
] | null | null | null | script/app/agg.py | Intelligent-Systems-Lab/ISL-BCFL | 42ceb86708a76e28b31c22b33c15ee9a6a745ec7 | [
"Apache-2.0"
] | null | null | null | import os
# import torch
import argparse
import base64
import sys
import io
import torch
import torch.nn as nn
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
def fullmodel2base64(model):
buffer = io.BytesIO()
torch.save(mode... | 19.55 | 56 | 0.734868 | import os
import argparse
import base64
import sys
import io
import torch
import torch.nn as nn
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
def fullmodel2base64(model):
buffer = io.BytesIO()
torch.save(model, buffer)
... | true | true |
f7044425b96c1b1b74a77404d1717095d1e2e08e | 192 | py | Python | q6.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | q6.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | q6.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | #Question No 6
#Risen Each Year For Next 25 Years
year =1
millimeter= 1.6
while(year<=25):
years=(year * millimeter)
print(" The ocean will rises each year is=" , years,)
year+=1 | 24 | 56 | 0.661458 |
year =1
millimeter= 1.6
while(year<=25):
years=(year * millimeter)
print(" The ocean will rises each year is=" , years,)
year+=1 | true | true |
f704446ccf2cd519c05582e5094cbf2d322f8140 | 1,530 | py | Python | main.py | tomsaudrins/api-service | a1262b63b3c11bed373fe12547f3a41b6478d648 | [
"MIT"
] | null | null | null | main.py | tomsaudrins/api-service | a1262b63b3c11bed373fe12547f3a41b6478d648 | [
"MIT"
] | null | null | null | main.py | tomsaudrins/api-service | a1262b63b3c11bed373fe12547f3a41b6478d648 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
import uvicorn
from src.routes import (
user,
employee,
car,
inventory,
product,
service,
dealership,
department,
)
from fastapi.middleware.cors import CORSMiddleware
from src.settings.envvariables import Settings
Settings().check_variables()
app = FastAPI()... | 32.553191 | 96 | 0.698039 | from fastapi import FastAPI
import uvicorn
from src.routes import (
user,
employee,
car,
inventory,
product,
service,
dealership,
department,
)
from fastapi.middleware.cors import CORSMiddleware
from src.settings.envvariables import Settings
Settings().check_variables()
app = FastAPI()... | true | true |
f70444a08deb7e59f97195740767e6b3556a8c02 | 4,464 | py | Python | server/apps/verticals/shipping/utils/org_quality_report.py | iotile/iotile_cloud | 9dc65ac86d3a730bba42108ed7d9bbb963d22ba6 | [
"MIT"
] | null | null | null | server/apps/verticals/shipping/utils/org_quality_report.py | iotile/iotile_cloud | 9dc65ac86d3a730bba42108ed7d9bbb963d22ba6 | [
"MIT"
] | null | null | null | server/apps/verticals/shipping/utils/org_quality_report.py | iotile/iotile_cloud | 9dc65ac86d3a730bba42108ed7d9bbb963d22ba6 | [
"MIT"
] | null | null | null | from django.db.models import Q
from apps.configattribute.models import ConfigAttribute
from apps.property.models import GenericProperty
from apps.utils.data_helpers.manager import DataManager
from apps.utils.iotile.variable import SYSTEM_VID
from apps.utils.timezone_utils import display_formatted_ts
class TripInfo(o... | 33.56391 | 125 | 0.5625 | from django.db.models import Q
from apps.configattribute.models import ConfigAttribute
from apps.property.models import GenericProperty
from apps.utils.data_helpers.manager import DataManager
from apps.utils.iotile.variable import SYSTEM_VID
from apps.utils.timezone_utils import display_formatted_ts
class TripInfo(o... | true | true |
f704457c6cc7a2334902e0a96a793b9399fd41ce | 157,354 | py | Python | core/tests/test_utils.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | core/tests/test_utils.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | core/tests/test_utils.py | luccasparoni/oppia | 988f7c1e818faf774ec424e33b5dd0267c40237b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 41.116802 | 125 | 0.628023 |
from __future__ import absolute_import
from __future__ import unicode_literals
import ast
import collections
import contextlib
import copy
import inspect
import itertools
import json
import logging
import os
import re
import unittest
from constants import constants
from core.controllers import ba... | true | true |
f704460cf7ea30ec843e7420c89fc0493ee56776 | 191 | py | Python | velbus/modules/__init__.py | gitd8400/python-velbus | ca5bcbb347b82f2e41b599e7544f560b5f355251 | [
"MIT"
] | null | null | null | velbus/modules/__init__.py | gitd8400/python-velbus | ca5bcbb347b82f2e41b599e7544f560b5f355251 | [
"MIT"
] | null | null | null | velbus/modules/__init__.py | gitd8400/python-velbus | ca5bcbb347b82f2e41b599e7544f560b5f355251 | [
"MIT"
] | null | null | null | """
:author: Thomas Delaet <thomas@delaet.org>
"""
from velbus.modules.vmb4ry import VMB4RYModule
from velbus.modules.vmbin import VMB6INModule
from velbus.modules.vmbin import VMB7INModule
| 23.875 | 46 | 0.806283 |
from velbus.modules.vmb4ry import VMB4RYModule
from velbus.modules.vmbin import VMB6INModule
from velbus.modules.vmbin import VMB7INModule
| true | true |
f70446cde10071c4761a7dc95d296e9fa2db3519 | 1,627 | py | Python | hijack/tests/test_admin.py | sondrelg/django-hijack | de8d72fa53cf0abf1ec63105dd7b58ff923528fb | [
"MIT"
] | null | null | null | hijack/tests/test_admin.py | sondrelg/django-hijack | de8d72fa53cf0abf1ec63105dd7b58ff923528fb | [
"MIT"
] | null | null | null | hijack/tests/test_admin.py | sondrelg/django-hijack | de8d72fa53cf0abf1ec63105dd7b58ff923528fb | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock
from django.urls import reverse
from hijack.contrib.admin import HijackUserAdminMixin
from hijack.tests.test_app.models import Post
class TestHijackUserAdminMixin:
def test_user_admin(self, admin_client):
url = reverse("admin:test_app_customuser_changelist")
r... | 38.738095 | 87 | 0.700061 | from unittest.mock import MagicMock
from django.urls import reverse
from hijack.contrib.admin import HijackUserAdminMixin
from hijack.tests.test_app.models import Post
class TestHijackUserAdminMixin:
def test_user_admin(self, admin_client):
url = reverse("admin:test_app_customuser_changelist")
r... | true | true |
f70447682772f8dce75902fd8f48d39c34673f82 | 3,109 | py | Python | modelpractice/modelpractice/settings.py | prernaniraj/python_django_rest_api | b69f5dc015c3d84c81bac4fc345d585513d3dda9 | [
"MIT"
] | null | null | null | modelpractice/modelpractice/settings.py | prernaniraj/python_django_rest_api | b69f5dc015c3d84c81bac4fc345d585513d3dda9 | [
"MIT"
] | null | null | null | modelpractice/modelpractice/settings.py | prernaniraj/python_django_rest_api | b69f5dc015c3d84c81bac4fc345d585513d3dda9 | [
"MIT"
] | null | null | null | """
Django settings for modelpractice project.
Generated by 'django-admin startproject' using Django 3.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import... | 25.694215 | 91 | 0.696365 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'ligk%x$+)qey=q+&d_nca7%s-_@zn4%g=kg_4+p!ga7n)-4nb@'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f704478779f04dbcbfcffa9eff8c9f6df4e7a789 | 7,764 | py | Python | g_packages/deepImpute/docker/deepimpute/deepimpute/multinet.py | lanagarmire/granatumx | 3dee3a8fb2ba851c31a9f6338aef1817217769f9 | [
"MIT"
] | 1 | 2021-03-04T13:04:28.000Z | 2021-03-04T13:04:28.000Z | g_packages/deepImpute/docker/deepimpute/deepimpute/multinet.py | lanagarmire/granatumx | 3dee3a8fb2ba851c31a9f6338aef1817217769f9 | [
"MIT"
] | 16 | 2020-01-28T23:03:40.000Z | 2022-02-10T00:30:16.000Z | g_packages/deepImpute/docker/deepimpute/deepimpute/multinet.py | lanagarmire/granatumx | 3dee3a8fb2ba851c31a9f6338aef1817217769f9 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import binascii
import warnings
import tempfile
from math import ceil
from multiprocessing import cpu_count, sharedctypes
from multiprocessing.pool import Pool
from sklearn.metrics import r2_score
from deepimpute.net import Net
from deepimpute.normalizer import Normaliz... | 36.971429 | 146 | 0.618367 | import os
import numpy as np
import pandas as pd
import binascii
import warnings
import tempfile
from math import ceil
from multiprocessing import cpu_count, sharedctypes
from multiprocessing.pool import Pool
from sklearn.metrics import r2_score
from deepimpute.net import Net
from deepimpute.normalizer import Normaliz... | true | true |
f70447f40f7fdf7642cec82e378beb85149aa765 | 8,476 | py | Python | dynamic_dynamodb/config/command_line_parser.py | ponprathip/dynamic-dynamodb | f0968215f606b9ff464fc4b633f01df60a8745b2 | [
"Apache-2.0"
] | null | null | null | dynamic_dynamodb/config/command_line_parser.py | ponprathip/dynamic-dynamodb | f0968215f606b9ff464fc4b633f01df60a8745b2 | [
"Apache-2.0"
] | null | null | null | dynamic_dynamodb/config/command_line_parser.py | ponprathip/dynamic-dynamodb | f0968215f606b9ff464fc4b633f01df60a8745b2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
""" Command line configuration parser """
import sys
import os.path
import argparse
import configparser
def parse():
""" Parse command line options """
parser = argparse.ArgumentParser(
description='Dynamic DynamoDB - Auto provisioning AWS DynamoDB')
parser.add_argument(
... | 38.880734 | 84 | 0.607126 |
import sys
import os.path
import argparse
import configparser
def parse():
parser = argparse.ArgumentParser(
description='Dynamic DynamoDB - Auto provisioning AWS DynamoDB')
parser.add_argument(
'-c', '--config',
help='Read configuration from a configuration file')
parser.add_argu... | true | true |
f7044a279a20984e104ff69ddf76ab1cc5fa13be | 4,076 | py | Python | tvizbase/rpc_client.py | inov8ru/thallid-viz | 302a44f8af257edad8a5d11be19fc423fe51b89c | [
"MIT"
] | 3 | 2019-09-27T15:21:14.000Z | 2019-10-24T15:13:50.000Z | tvizbase/rpc_client.py | inov8ru/thallid-viz | 302a44f8af257edad8a5d11be19fc423fe51b89c | [
"MIT"
] | null | null | null | tvizbase/rpc_client.py | inov8ru/thallid-viz | 302a44f8af257edad8a5d11be19fc423fe51b89c | [
"MIT"
] | 1 | 2022-02-12T16:27:05.000Z | 2022-02-12T16:27:05.000Z | # -*- coding: utf-8 -*-
from requests import Session
from requests.adapters import HTTPAdapter
from requests.exceptions import ConnectionError
import json
from time import sleep, time
from pprint import pprint
from itertools import cycle
from .storage import nodes, api_total
#from .proxy import Proxy
class Http():
... | 27.540541 | 105 | 0.648921 |
from requests import Session
from requests.adapters import HTTPAdapter
from requests.exceptions import ConnectionError
import json
from time import sleep, time
from pprint import pprint
from itertools import cycle
from .storage import nodes, api_total
class Http():
http = Session()
proxies = None
class RpcCl... | true | true |
f7044a71ed7e9f453f633fd06fffede821afd456 | 3,600 | py | Python | tests/integration/projects/general/service.py | DrizzlingCattus/BentoML | 3ca0cc134c72d92e2e806113df1677e38f2567e0 | [
"Apache-2.0"
] | null | null | null | tests/integration/projects/general/service.py | DrizzlingCattus/BentoML | 3ca0cc134c72d92e2e806113df1677e38f2567e0 | [
"Apache-2.0"
] | null | null | null | tests/integration/projects/general/service.py | DrizzlingCattus/BentoML | 3ca0cc134c72d92e2e806113df1677e38f2567e0 | [
"Apache-2.0"
] | null | null | null | import json
import pathlib
import sys
import time
from typing import Sequence
import bentoml
from bentoml.adapters import (
DataframeInput,
FileInput,
ImageInput,
JsonInput,
MultiImageInput,
)
from bentoml.frameworks.sklearn import SklearnModelArtifact
from bentoml.handlers import DataframeHandler ... | 34.951456 | 88 | 0.695 | import json
import pathlib
import sys
import time
from typing import Sequence
import bentoml
from bentoml.adapters import (
DataframeInput,
FileInput,
ImageInput,
JsonInput,
MultiImageInput,
)
from bentoml.frameworks.sklearn import SklearnModelArtifact
from bentoml.handlers import DataframeHandler ... | true | true |
f7044b4832232e3b67064f3a65d9a30b120554fc | 236 | py | Python | scripts/make_gifs.py | bchao1/stereo-magnification | 031376675430a459f4bde768eb5c652f1d22a0a4 | [
"Apache-2.0"
] | null | null | null | scripts/make_gifs.py | bchao1/stereo-magnification | 031376675430a459f4bde768eb5c652f1d22a0a4 | [
"Apache-2.0"
] | null | null | null | scripts/make_gifs.py | bchao1/stereo-magnification | 031376675430a459f4bde768eb5c652f1d22a0a4 | [
"Apache-2.0"
] | null | null | null | from PIL import Image
images = []
for i in range(9):
images.append(Image.open(f"../examples/lf/results/render_0{i}_{i}.0.png"))
images[0].save("../examples/lf/out.gif", save_all=True, append_images=images[1:], duration=100, loop=0) | 39.333333 | 103 | 0.699153 | from PIL import Image
images = []
for i in range(9):
images.append(Image.open(f"../examples/lf/results/render_0{i}_{i}.0.png"))
images[0].save("../examples/lf/out.gif", save_all=True, append_images=images[1:], duration=100, loop=0) | true | true |
f7044ca3e16964f42ff76f78419427012e7f0013 | 8,104 | py | Python | src/waldur_vmware/models.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_vmware/models.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_vmware/models.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import FieldTracker
from waldur_core.core import models as core_models
from waldur_core.structure import models as structure_models
class VirtualMachineMixin(models.Model):
class Meta:
abstract = True
... | 29.576642 | 102 | 0.659427 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import FieldTracker
from waldur_core.core import models as core_models
from waldur_core.structure import models as structure_models
class VirtualMachineMixin(models.Model):
class Meta:
abstract = True
... | true | true |
f7044cad6db8570c9fda70bb4a54726e8a97dc08 | 321 | py | Python | log_metrics/__init__.py | simpleenergy/log-metrics | af91bfecc2a6f39ee26a2e394e3782495ffc98b1 | [
"Apache-2.0"
] | 5 | 2015-09-23T23:15:37.000Z | 2017-11-27T06:43:54.000Z | log_metrics/__init__.py | simpleenergy/log-metrics | af91bfecc2a6f39ee26a2e394e3782495ffc98b1 | [
"Apache-2.0"
] | 1 | 2015-02-07T23:26:32.000Z | 2015-02-07T23:26:32.000Z | log_metrics/__init__.py | simpleenergy/log-metrics | af91bfecc2a6f39ee26a2e394e3782495ffc98b1 | [
"Apache-2.0"
] | 2 | 2015-01-19T05:58:43.000Z | 2018-07-30T17:24:57.000Z | # -*- coding: utf-8 -*-
# Meta
__version__ = "0.0.4"
__author__ = 'Rhys Elsmore'
__email__ = 'me@rhys.io'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2014 Rhys Elsmore'
# Module Namespace
from .core import MetricsLogger, GroupMetricsLogger
from .api import timer, increment, sample, measure, unique, group
... | 20.0625 | 65 | 0.725857 |
__version__ = "0.0.4"
__author__ = 'Rhys Elsmore'
__email__ = 'me@rhys.io'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2014 Rhys Elsmore'
from .core import MetricsLogger, GroupMetricsLogger
from .api import timer, increment, sample, measure, unique, group
| true | true |
f7044d3c0712db7cd4bb71dcc732d7614526c066 | 1,423 | bzl | Python | proto/workspace.bzl | Yannic/rules_proto | 4a4b83abfbfe018387a5b58986efa888850048c4 | [
"Apache-2.0"
] | 5 | 2019-06-13T19:03:50.000Z | 2019-08-07T14:23:52.000Z | proto/workspace.bzl | Yannic/rules_proto | 4a4b83abfbfe018387a5b58986efa888850048c4 | [
"Apache-2.0"
] | 5 | 2019-06-18T11:44:50.000Z | 2019-06-24T14:05:35.000Z | proto/workspace.bzl | Yannic/rules_proto | 4a4b83abfbfe018387a5b58986efa888850048c4 | [
"Apache-2.0"
] | 1 | 2019-06-19T21:50:23.000Z | 2019-06-19T21:50:23.000Z | ## Copyright 2019 The Rules Protobuf 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 require... | 36.487179 | 91 | 0.740689 | proto_register_toolchains():
print(_DEPRECATED_REPOSITORY_RULE_MESSAGE.format(
old_rule = "proto_register_toolchains",
new_rule = "rules_proto_toolchains",
))
rules_proto_toolchains()
| true | true |
f7044f1d26e519871cd3864ab2531d33132e654e | 21,972 | py | Python | test/python/test_tensor.py | XinChCh/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | [
"Apache-2.0"
] | 2,354 | 2015-05-05T03:01:56.000Z | 2019-10-22T15:08:11.000Z | test/python/test_tensor.py | Dadaguaibuhaoyisi/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | [
"Apache-2.0"
] | 332 | 2019-10-24T15:06:32.000Z | 2022-03-07T06:22:32.000Z | test/python/test_tensor.py | Dadaguaibuhaoyisi/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | [
"Apache-2.0"
] | 607 | 2015-05-03T14:09:05.000Z | 2019-10-21T09:49:21.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.495961 | 83 | 0.563444 |
from __future__ import division
import math
import unittest
import random
import numpy as np
from singa import tensor
from singa import singa_wrap as singa_api
from singa import autograd
from cuda_helper import gpu_dev, cpu_dev
class TestTensorMethods(unittest.TestCase):
def setUp(self):
... | true | true |
f7044ff308e002990bf93fd6f412f89dff8bcf34 | 4,580 | py | Python | authors/apps/articles/tests/endpoints/test_get.py | andela/ah-jumanji- | a304718929936dd4a759d737fb3570d6cc25fb76 | [
"BSD-3-Clause"
] | 1 | 2018-12-23T15:31:54.000Z | 2018-12-23T15:31:54.000Z | authors/apps/articles/tests/endpoints/test_get.py | andela/ah-jumanji- | a304718929936dd4a759d737fb3570d6cc25fb76 | [
"BSD-3-Clause"
] | 26 | 2018-11-27T09:13:15.000Z | 2021-06-10T20:58:57.000Z | authors/apps/articles/tests/endpoints/test_get.py | andela/ah-jumanji- | a304718929936dd4a759d737fb3570d6cc25fb76 | [
"BSD-3-Clause"
] | 2 | 2019-01-10T22:14:28.000Z | 2019-11-04T07:33:43.000Z | import json
from rest_framework.test import APITestCase
from django.urls import reverse
from rest_framework import status
from django.contrib.auth import get_user_model
from authors.apps.articles.models import Articles
from authors.apps.profiles.models import Profile
class TestGetEndpoint(APITestCase):
def set... | 35.230769 | 76 | 0.627293 | import json
from rest_framework.test import APITestCase
from django.urls import reverse
from rest_framework import status
from django.contrib.auth import get_user_model
from authors.apps.articles.models import Articles
from authors.apps.profiles.models import Profile
class TestGetEndpoint(APITestCase):
def set... | true | true |
f70450e5817c83cfcb1a4c26acddb49086b5df92 | 566 | py | Python | utilities/ResourceManager.py | sanazb/datastories-semeval2017-task4 | c752620e3d694a1c5bcd444db8cf3e5ed5cd6651 | [
"MIT"
] | 218 | 2017-05-15T13:36:34.000Z | 2021-11-07T06:38:39.000Z | utilities/ResourceManager.py | sanazb/datastories-semeval2017-task4 | c752620e3d694a1c5bcd444db8cf3e5ed5cd6651 | [
"MIT"
] | 14 | 2017-07-24T07:45:58.000Z | 2019-11-02T09:22:37.000Z | utilities/ResourceManager.py | sanazb/datastories-semeval2017-task4 | c752620e3d694a1c5bcd444db8cf3e5ed5cd6651 | [
"MIT"
] | 70 | 2017-05-12T08:06:56.000Z | 2022-03-21T14:07:52.000Z | from abc import ABCMeta, abstractmethod
from frozendict import frozendict
class ResourceManager(metaclass=ABCMeta):
def __init__(self):
self.wv_filename = ""
self.parsed_filename = ""
@abstractmethod
def write(self):
"""
parse the raw file/files and write the data to disk... | 19.517241 | 59 | 0.583039 | from abc import ABCMeta, abstractmethod
from frozendict import frozendict
class ResourceManager(metaclass=ABCMeta):
def __init__(self):
self.wv_filename = ""
self.parsed_filename = ""
@abstractmethod
def write(self):
pass
@abstractmethod
def read(self):
pass
... | true | true |
f70451dd563a66eff92f232ce71a939630bab2d2 | 22,696 | py | Python | ssn_dataset.py | hyperfraise/action-detection | a3ee263ed701ed251cd0a79830ef796889ff366e | [
"BSD-3-Clause"
] | 1 | 2020-02-12T09:30:23.000Z | 2020-02-12T09:30:23.000Z | ssn_dataset.py | hyperfraise/action-detection | a3ee263ed701ed251cd0a79830ef796889ff366e | [
"BSD-3-Clause"
] | null | null | null | ssn_dataset.py | hyperfraise/action-detection | a3ee263ed701ed251cd0a79830ef796889ff366e | [
"BSD-3-Clause"
] | null | null | null | import torch.utils.data as data
import os
import os.path
from numpy.random import randint
from ops.io import load_proposal_file
from transforms import *
from ops.utils import temporal_iou
class SSNInstance:
def __init__(
self,
start_frame,
end_frame,
video_frame_count,
fps... | 32.330484 | 126 | 0.554195 | import torch.utils.data as data
import os
import os.path
from numpy.random import randint
from ops.io import load_proposal_file
from transforms import *
from ops.utils import temporal_iou
class SSNInstance:
def __init__(
self,
start_frame,
end_frame,
video_frame_count,
fps... | true | true |
f704520d1a228703aaf40ee1af453d7651947d38 | 45 | py | Python | routes/websocket/__init__.py | ceyzaguirre4/starlette-mvc | 03d0f38e11669e988a084e84b890ecdcca449f64 | [
"MIT"
] | 8 | 2019-06-19T15:32:47.000Z | 2021-02-01T19:57:26.000Z | routes/websocket/__init__.py | ceyzaguirre4/starlette-mvc | 03d0f38e11669e988a084e84b890ecdcca449f64 | [
"MIT"
] | null | null | null | routes/websocket/__init__.py | ceyzaguirre4/starlette-mvc | 03d0f38e11669e988a084e84b890ecdcca449f64 | [
"MIT"
] | 2 | 2019-07-31T22:23:56.000Z | 2021-02-01T19:57:29.000Z | from .routes import app as websockets_routes
| 22.5 | 44 | 0.844444 | from .routes import app as websockets_routes
| true | true |
f7045338c41d6965d06ef3953f92771273c53481 | 786 | py | Python | server/models/utils.py | Justinyu1618/Coronalert | df7d66bec147ea1f47105102582bc25469e4bee2 | [
"MIT"
] | 2 | 2020-04-19T07:08:39.000Z | 2020-06-01T21:22:07.000Z | server/models/utils.py | HackCameroon/Coronalert | df7d66bec147ea1f47105102582bc25469e4bee2 | [
"MIT"
] | 3 | 2020-10-13T01:06:56.000Z | 2022-02-27T01:51:31.000Z | server/models/utils.py | HackCameroon/Coronalert | df7d66bec147ea1f47105102582bc25469e4bee2 | [
"MIT"
] | 1 | 2020-05-08T08:37:15.000Z | 2020-05-08T08:37:15.000Z | import json
from server import db
from sqlalchemy.ext import mutable
class JsonEncodedDict(db.TypeDecorator):
impl = db.Text
def process_bind_param(self, value, dialect):
if value is None:
return '{}'
else:
return json.dumps(value)
def process_result_value(self, val... | 32.75 | 110 | 0.604326 | import json
from server import db
from sqlalchemy.ext import mutable
class JsonEncodedDict(db.TypeDecorator):
impl = db.Text
def process_bind_param(self, value, dialect):
if value is None:
return '{}'
else:
return json.dumps(value)
def process_result_value(self, val... | true | true |
f704533cb05012bfc523241ab664a84ebc5b8dad | 7,054 | py | Python | obsolete/reports/pipeline_capseq/trackers/macs_replicated_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 11 | 2018-09-07T11:33:23.000Z | 2022-01-07T12:16:11.000Z | obsolete/reports/pipeline_capseq/trackers/macs_replicated_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 102 | 2018-03-22T15:35:26.000Z | 2022-03-23T17:46:16.000Z | obsolete/reports/pipeline_capseq/trackers/macs_replicated_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 7 | 2018-06-11T15:01:41.000Z | 2020-03-31T09:29:33.000Z | import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import scipy.stats
import numpy.ma
import Stats
import Histogram
from cgatReport.Tracker import *
from cpgReport import *
##########################################################################
class replica... | 38.546448 | 164 | 0.568897 | import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import scipy.stats
import numpy.ma
import Stats
import Histogram
from cgatReport.Tracker import *
from cpgReport import *
| true | true |
f7045379712a0cda1d66cb3115fa1f0870d8720e | 689 | py | Python | library/migrations/0002_auto_20180704_0002.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | null | null | null | library/migrations/0002_auto_20180704_0002.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | 1 | 2018-07-14T07:35:55.000Z | 2018-07-16T07:40:49.000Z | library/migrations/0002_auto_20180704_0002.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-07-04 00:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('library', '0001_initial'),
]
operations = [
... | 25.518519 | 120 | 0.619739 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('library', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='module',
... | true | true |
f704561340c1d7a365b883b6ae1bea0dbbbbec2d | 333 | py | Python | test_settings.py | pwilczynskiclearcode/django-nuit | e1b619c00db36fba48683e9cf3d51cf4460f99c8 | [
"Apache-2.0"
] | 5 | 2016-05-15T12:43:24.000Z | 2018-10-06T07:45:38.000Z | test_settings.py | pwilczynskiclearcode/django-nuit | e1b619c00db36fba48683e9cf3d51cf4460f99c8 | [
"Apache-2.0"
] | 12 | 2016-04-21T22:01:55.000Z | 2017-04-20T09:27:56.000Z | test_settings.py | pwilczynskiclearcode/django-nuit | e1b619c00db36fba48683e9cf3d51cf4460f99c8 | [
"Apache-2.0"
] | 6 | 2016-04-21T23:27:48.000Z | 2018-02-22T16:24:11.000Z | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
ROOT_URLCONF = 'django_autoconfig.autourlconf'
INSTALLED_APPS = [
'django.contrib.auth',
'nuit',
]
STATIC_URL = '/static/'
STATIC_ROOT = '.static'
from django_autoconfig.autoconfig import configure_settings
configure_setting... | 22.2 | 59 | 0.6997 | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
ROOT_URLCONF = 'django_autoconfig.autourlconf'
INSTALLED_APPS = [
'django.contrib.auth',
'nuit',
]
STATIC_URL = '/static/'
STATIC_ROOT = '.static'
from django_autoconfig.autoconfig import configure_settings
configure_setting... | true | true |
f70456c2fe01d36dc70a451996e2eedc3ab16d0d | 3,307 | py | Python | src/my_blog/settings.py | zainab66/blog-django-ar | 5e2643f40afb11f648841fd2192a459f6141505b | [
"bzip2-1.0.6"
] | 1 | 2020-02-16T02:52:25.000Z | 2020-02-16T02:52:25.000Z | src/my_blog/settings.py | zainab66/blog-django-ar | 5e2643f40afb11f648841fd2192a459f6141505b | [
"bzip2-1.0.6"
] | 2 | 2021-03-18T23:50:25.000Z | 2021-09-22T18:35:25.000Z | src/my_blog/settings.py | zainab66/blog-django-ar | 5e2643f40afb11f648841fd2192a459f6141505b | [
"bzip2-1.0.6"
] | null | null | null | """
Django settings for my_blog project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
#... | 26.03937 | 91 | 0.702449 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@7+q1q@_=iniipvuc%nfs)5qauaax2g0cnc1fxzos52t-9ml=m'
DEBUG = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'sarah.1024z@gmail.com'
EMAIL_HOST_PASSWORD = 'rzan2015'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_... | true | true |
f70456d0ba561c2a6d0de8e56a180302aea268a7 | 4,949 | py | Python | samcli/commands/package/package_context.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/package/package_context.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/package/package_context.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | """
Logic for uploading to s3 based on supplied template file and s3 bucket
"""
# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License i... | 33.214765 | 110 | 0.6765 |
import json
import logging
import os
import boto3
import click
import docker
from botocore.config import Config
from samcli.commands.package.exceptions import PackageFailedError
from samcli.lib.package.artifact_exporter import Template
from samcli.lib.package.ecr_uploader import ECRUploader
from samcli.... | true | true |
f7045706a79e9f09f2b7bf296887bce361af2fb5 | 1,658 | py | Python | src/model/vdsr.py | delldu/EDSR | 98752b57a3091e693c523e710380d369f9913041 | [
"MIT"
] | 1 | 2019-10-19T13:28:30.000Z | 2019-10-19T13:28:30.000Z | src/model/vdsr.py | delldu/EDSR | 98752b57a3091e693c523e710380d369f9913041 | [
"MIT"
] | null | null | null | src/model/vdsr.py | delldu/EDSR | 98752b57a3091e693c523e710380d369f9913041 | [
"MIT"
] | null | null | null | from model import common
import torch.nn as nn
import torch.nn.init as init
url = {
'r20f64': ''
}
def make_model(args, parent=False):
return VDSR(args)
class VDSR(nn.Module):
def __init__(self, args, conv=common.default_conv):
super(VDSR, self).__init__()
n_resblocks = args.n_resblocks... | 25.507692 | 73 | 0.598311 | from model import common
import torch.nn as nn
import torch.nn.init as init
url = {
'r20f64': ''
}
def make_model(args, parent=False):
return VDSR(args)
class VDSR(nn.Module):
def __init__(self, args, conv=common.default_conv):
super(VDSR, self).__init__()
n_resblocks = args.n_resblocks... | true | true |
f704591e6a08033243efa0eee051057ba7a55fd2 | 9,454 | py | Python | src/zeit/content/image/transform.py | ZeitOnline/zeit.content.image | 0ea8d125f8ff7a2a4d8333542cded9856e25805a | [
"BSD-3-Clause"
] | null | null | null | src/zeit/content/image/transform.py | ZeitOnline/zeit.content.image | 0ea8d125f8ff7a2a4d8333542cded9856e25805a | [
"BSD-3-Clause"
] | 11 | 2016-02-25T15:22:34.000Z | 2019-02-26T12:20:59.000Z | src/zeit/content/image/transform.py | ZeitOnline/zeit.content.image | 0ea8d125f8ff7a2a4d8333542cded9856e25805a | [
"BSD-3-Clause"
] | 3 | 2015-07-28T11:11:56.000Z | 2016-11-15T13:23:57.000Z | import PIL.Image
import PIL.ImageColor
import PIL.ImageEnhance
import zeit.cms.repository.folder
import zeit.connector.interfaces
import zeit.content.image.interfaces
import zope.app.appsetup.product
import zope.component
import zope.interface
import zope.security.proxy
class ImageTransform(object):
zope.interfa... | 38.90535 | 79 | 0.649884 | import PIL.Image
import PIL.ImageColor
import PIL.ImageEnhance
import zeit.cms.repository.folder
import zeit.connector.interfaces
import zeit.content.image.interfaces
import zope.app.appsetup.product
import zope.component
import zope.interface
import zope.security.proxy
class ImageTransform(object):
zope.interfa... | true | true |
f70459583fe601a593e7ccd0e3b32eff6fde209c | 7,829 | py | Python | examples/undocumented/python_modular/graphical/statistics_quadratic_time_mmd.py | srgnuclear/shogun | 33c04f77a642416376521b0cd1eed29b3256ac13 | [
"Ruby",
"MIT"
] | 1 | 2015-11-05T18:31:14.000Z | 2015-11-05T18:31:14.000Z | examples/undocumented/python_modular/graphical/statistics_quadratic_time_mmd.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | examples/undocumented/python_modular/graphical/statistics_quadratic_time_mmd.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | #
# This program is free software you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation either version 3 of the License, or
# (at your option) any later version.
#
# Written (C) 2012-2013 Heiko Strathmann
#
from numpy import *
from py... | 39.741117 | 180 | 0.770852 |
from numpy import *
from pylab import *
from scipy import *
from modshogun import RealFeatures
from modshogun import MeanShiftDataGenerator
from modshogun import GaussianKernel, CombinedKernel
from modshogun import QuadraticTimeMMD, MMDKernelSelectionMax
from modshogun import PERMUTATION, MMD2_SPECTRUM, MMD2_G... | false | true |
f70459c5cac1ef72f59035358cf6fe0cccf00ab0 | 3,418 | py | Python | tests/unit/test_parameters/test_current_functions.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_parameters/test_current_functions.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_parameters/test_current_functions.py | NunoEdgarGFlowHub/PyBaMM | 4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190 | [
"BSD-3-Clause"
] | null | null | null | #
# Tests for current input functions
#
import pybamm
import numbers
import unittest
import numpy as np
class TestCurrentFunctions(unittest.TestCase):
def test_constant_current(self):
# test simplify
current = pybamm.electrical_parameters.current_with_time
parameter_values = pybamm.Paramet... | 32.245283 | 88 | 0.622001 |
import pybamm
import numbers
import unittest
import numpy as np
class TestCurrentFunctions(unittest.TestCase):
def test_constant_current(self):
current = pybamm.electrical_parameters.current_with_time
parameter_values = pybamm.ParameterValues(
{
"Typical cur... | true | true |
f7045a7748f2d0754f675332513daaafa28aceaf | 940 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/domainservice/models/SubDomainExist.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/domainservice/models/SubDomainExist.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/domainservice/models/SubDomainExist.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 31.333333 | 75 | 0.711702 |
class SubDomainExist(object):
def __init__(self, domain=None, isExist=None):
self.domain = domain
self.isExist = isExist
| true | true |
f7045a8b76dd75929fb90ffcd1baf9e5c780d065 | 9,167 | py | Python | sdk/python/pulumi_azure_native/network/v20161201/get_public_ip_address.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20161201/get_public_ip_address.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20161201/get_public_ip_address.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.84322 | 295 | 0.66423 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetPublicIPAddressResult',
'AwaitableGetPublicIPAddressResult',
'get_public_ip_address',
]
@pulumi.output_type
class Get... | true | true |
f7045aca0807423bddc8738c277100b4972f3dc4 | 891 | py | Python | examples/command/unix_ps.py | carr-elagheb/moler | b896ff668d9cc3704b6f806f7c2bf6e76c13427d | [
"BSD-3-Clause"
] | null | null | null | examples/command/unix_ps.py | carr-elagheb/moler | b896ff668d9cc3704b6f806f7c2bf6e76c13427d | [
"BSD-3-Clause"
] | null | null | null | examples/command/unix_ps.py | carr-elagheb/moler | b896ff668d9cc3704b6f806f7c2bf6e76c13427d | [
"BSD-3-Clause"
] | null | null | null | from moler.cmd.unix.ps import Ps
from moler.observable_connection import ObservableConnection, get_connection
from moler.io.raw.terminal import ThreadedTerminal
# v.1 - combine all manually
# moler_conn = ObservableConnection()
# terminal = ThreadedTerminal(moler_connection=moler_conn)
# v.2 - let factory combine
term... | 35.64 | 76 | 0.728395 | from moler.cmd.unix.ps import Ps
from moler.observable_connection import ObservableConnection, get_connection
from moler.io.raw.terminal import ThreadedTerminal
terminal = get_connection(io_type='terminal', variant='threaded')
with terminal.open():
ps_cmd = Ps(connection=terminal.moler_connection, options="-... | true | true |
f7045b7726258ee50846aef00faea6ad2f193365 | 5,213 | py | Python | hym/ac.py | AugustUnderground/oaceis | 73abc3b9703b84322764d2a40def915d8c1e69a7 | [
"MIT"
] | null | null | null | hym/ac.py | AugustUnderground/oaceis | 73abc3b9703b84322764d2a40def915d8c1e69a7 | [
"MIT"
] | null | null | null | hym/ac.py | AugustUnderground/oaceis | 73abc3b9703b84322764d2a40def915d8c1e69a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0xde71c936
# Compiled with Coconut version 2.0.0-a_dev33 [How Not to Be Seen]
# Coconut Header: -------------------------------------------------------------
from __future__ import print_function, absolute_import, unicode_literals, division
import sy... | 46.544643 | 987 | 0.750815 |
from __future__ import print_function, absolute_import, unicode_literals, division
import sys as _coconut_sys, os as _coconut_os
_coconut_file_dir = _coconut_os.path.dirname(_coconut_os.path.abspath(__file__))
_coconut_cached_module = _coconut_sys.modules.get(str("__coconut__"))
if _coconut_cached_module is not... | true | true |
f7045cc997340a8708c325c5a56407dc3ecffd1d | 1,604 | py | Python | SS-GMNN-GraphMix/GraphMix-par/run_citeseer_ss.py | TAMU-VITA/SS-GCNs | 644f8a5f3b507be6d59be02747be406fabd8b8f9 | [
"MIT"
] | 1 | 2021-06-07T15:18:10.000Z | 2021-06-07T15:18:10.000Z | SS-GMNN-GraphMix/GraphMix-par/run_citeseer_ss.py | TAMU-VITA/SS-GCNs | 644f8a5f3b507be6d59be02747be406fabd8b8f9 | [
"MIT"
] | null | null | null | SS-GMNN-GraphMix/GraphMix-par/run_citeseer_ss.py | TAMU-VITA/SS-GCNs | 644f8a5f3b507be6d59be02747be406fabd8b8f9 | [
"MIT"
] | null | null | null | import sys
import os
import copy
import json
import datetime
opt = dict()
opt['dataset'] = '../data/citeseer'
opt['hidden_dim'] = 16
opt['input_dropout'] = 0.5
opt['dropout'] = 0
opt['optimizer'] = 'adam'
opt['lr'] = 0.01
opt['decay'] = 5e-4
opt['self_link_weight'] = 1.0
opt['pre_epoch'] = 2000
opt['epoch'] = 100
opt... | 21.675676 | 51 | 0.598504 | import sys
import os
import copy
import json
import datetime
opt = dict()
opt['dataset'] = '../data/citeseer'
opt['hidden_dim'] = 16
opt['input_dropout'] = 0.5
opt['dropout'] = 0
opt['optimizer'] = 'adam'
opt['lr'] = 0.01
opt['decay'] = 5e-4
opt['self_link_weight'] = 1.0
opt['pre_epoch'] = 2000
opt['epoch'] = 100
opt... | true | true |
f7045d94952b05c34c83c62669bb8a4442772b67 | 12,907 | py | Python | Core/hippoSeg/LiviaNet/startTraining.py | YongLiuLab/BrainRadiomicsTools | 19b440acd554ee920857c306442b6d2c411dca88 | [
"Apache-2.0",
"BSD-3-Clause"
] | 10 | 2019-09-26T03:12:52.000Z | 2022-02-25T06:05:38.000Z | Core/hippoSeg/LiviaNet/startTraining.py | YongLiuLab/BrainRadiomicsTools | 19b440acd554ee920857c306442b6d2c411dca88 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | Core/hippoSeg/LiviaNet/startTraining.py | YongLiuLab/BrainRadiomicsTools | 19b440acd554ee920857c306442b6d2c411dca88 | [
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2020-02-26T01:54:48.000Z | 2022-03-19T01:23:55.000Z | """
Copyright (c) 2016, Jose Dolz .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the f... | 48.340824 | 153 | 0.581777 |
import os
import numpy as np
from Modules.IO.sampling import getSamplesSubepoch
from Modules.General.Utils import dump_model_to_gzip_file
from Modules.General.Utils import getImagesSet
from Modules.General.Utils import load_model_from_gzip_file
from Modules.Parsers.parsersUtils import parserConfigIni
from startTesti... | true | true |
f7045e707bad5fe79cb0eae215451a05a660f48a | 13,388 | py | Python | potion/envs/minigolf.py | T3p/policy-optimization | 77006545779823737c4ca3b19e9d80506015c132 | [
"MIT"
] | null | null | null | potion/envs/minigolf.py | T3p/policy-optimization | 77006545779823737c4ca3b19e9d80506015c132 | [
"MIT"
] | null | null | null | potion/envs/minigolf.py | T3p/policy-optimization | 77006545779823737c4ca3b19e9d80506015c132 | [
"MIT"
] | 1 | 2019-09-08T15:11:55.000Z | 2019-09-08T15:11:55.000Z | from numbers import Number
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import math as m
from scipy.stats import norm
"""
Minigolf task.
References
----------
- Penner, A. R. "The physics of putting." Canadian Journal of Physics 80.2 (2002): 83-96.
"""
class MiniGolf(gym.Env)... | 33.386534 | 133 | 0.561025 | from numbers import Number
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import math as m
from scipy.stats import norm
class MiniGolf(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 30
}
def __init__(self):
... | true | true |
f7045efad70ff6e1be66e1bccf1a06a420b019bb | 636 | py | Python | Pyduino/Boards/Uno.py | ItzTheDodo/Pyduino | a68d6a3214d5fb452e8b8e53cb013ee7205734bb | [
"Apache-2.0"
] | null | null | null | Pyduino/Boards/Uno.py | ItzTheDodo/Pyduino | a68d6a3214d5fb452e8b8e53cb013ee7205734bb | [
"Apache-2.0"
] | null | null | null | Pyduino/Boards/Uno.py | ItzTheDodo/Pyduino | a68d6a3214d5fb452e8b8e53cb013ee7205734bb | [
"Apache-2.0"
] | null | null | null |
class UnoInfo:
def __init__(self):
self.dataPins = 13
self.analogInPins = 5
self.GND = 3
self.pow = [3.3, 5]
self.TX = 1
self.RX = 0
def getMainInfo(self):
return {"0": self.dataPins, "1": self.GND, "2": self.pow}
def getDigitalPins(s... | 19.875 | 66 | 0.536164 |
class UnoInfo:
def __init__(self):
self.dataPins = 13
self.analogInPins = 5
self.GND = 3
self.pow = [3.3, 5]
self.TX = 1
self.RX = 0
def getMainInfo(self):
return {"0": self.dataPins, "1": self.GND, "2": self.pow}
def getDigitalPins(s... | true | true |
f7046024f61186b826309ccf12e7b065fb9976cb | 952 | py | Python | Python/Simple-Sender-Receiver/receiver-tls.py | nplab/IOT-Project | b0c1f2b5f4c130ef4e4933801da8792a95609fb4 | [
"BSD-3-Clause"
] | null | null | null | Python/Simple-Sender-Receiver/receiver-tls.py | nplab/IOT-Project | b0c1f2b5f4c130ef4e4933801da8792a95609fb4 | [
"BSD-3-Clause"
] | null | null | null | Python/Simple-Sender-Receiver/receiver-tls.py | nplab/IOT-Project | b0c1f2b5f4c130ef4e4933801da8792a95609fb4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import paho.mqtt.client as mqtt
import json
import random
import math
import time
import ssl
config_mqtt_broker_ip = "iot.fh-muenster.de"
config_mqtt_client_id = "dummy-receiver-" + str(random.randint(1000, 9999));
config_mqtt_topic = "sensor/60:01:94:4A:AF:7A"
ts_last_message = int(round(... | 27.2 | 79 | 0.767857 |
import paho.mqtt.client as mqtt
import json
import random
import math
import time
import ssl
config_mqtt_broker_ip = "iot.fh-muenster.de"
config_mqtt_client_id = "dummy-receiver-" + str(random.randint(1000, 9999));
config_mqtt_topic = "sensor/60:01:94:4A:AF:7A"
ts_last_message = int(round(time.time() * 1000))
... | true | true |
f704617f9290ee2bf253dd9c32d76dbfa0b5aedf | 5,785 | py | Python | WebScraping2.py | jenildesai25/WebScrapping | 41937094a7963d53ab09e3ceff055dca4a95f13f | [
"MIT"
] | null | null | null | WebScraping2.py | jenildesai25/WebScrapping | 41937094a7963d53ab09e3ceff055dca4a95f13f | [
"MIT"
] | null | null | null | WebScraping2.py | jenildesai25/WebScrapping | 41937094a7963d53ab09e3ceff055dca4a95f13f | [
"MIT"
] | null | null | null |
# Online References used :
# https://github.com/imadmali/movie-scraper/blob/master/MojoLinkExtract.py
# https://www.crummy.com/software/BeautifulSoup/bs4/doc/
# https://nycdatascience.com/blog/student-works/scraping-box-office-mojo/
# https://www.youtube.com/watch?v=XQgXKtPSzUI
# https://www.youtube.com/watch?v=aIPqt-... | 46.28 | 197 | 0.584788 |
from bs4 import BeautifulSoup
import pandas as pd
import os
import requests
import glob
import re
def scrape_data_for_actors():
file_path = os.path.join(os.path.join(os.environ['USERPROFILE']),
'Desktop')
file_path = os.path.join(file_path,
... | true | true |
f70461a1b7fa5f8f95a75d2f5d58265ffdffea63 | 4,593 | py | Python | var/spack/repos/builtin/packages/py-pyqt5/package.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-pyqt5/package.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-pyqt5/package.py | fcannini/spack | 9b3f5f3890025494ffa620d144d22a4734c8fcee | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class PyPyqt5(SIPPackage):
"""PyQt is a set of Python v2 and v3 bindings for The Qt Co... | 44.592233 | 118 | 0.588287 |
from spack import *
import os
class PyPyqt5(SIPPackage):
homepage = "https://www.riverbankcomputing.com/software/pyqt/intro"
url = "https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.0/PyQt5_gpl-5.13.0.tar.gz"
list_url = "https://www.riverbankcomputing.com/software/pyqt/download5"
... | true | true |
f70462794e04bd363c3d9166018d419774a06f8d | 138 | py | Python | test/fixtures.py | steinnes/pykubeks | 20b52f5da2405ce8997a923d526e2e4833ce3c01 | [
"Apache-2.0"
] | null | null | null | test/fixtures.py | steinnes/pykubeks | 20b52f5da2405ce8997a923d526e2e4833ce3c01 | [
"Apache-2.0"
] | 2 | 2019-03-01T15:58:40.000Z | 2019-03-04T11:07:24.000Z | test/fixtures.py | steinnes/pykubeks | 20b52f5da2405ce8997a923d526e2e4833ce3c01 | [
"Apache-2.0"
] | null | null | null | AUTHPLUGIN_FIXTURE = '{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1alpha1","spec":{},"status":{"token":"test"}}'
| 69 | 137 | 0.710145 | AUTHPLUGIN_FIXTURE = '{"kind":"ExecCredential","apiVersion":"client.authentication.k8s.io/v1alpha1","spec":{},"status":{"token":"test"}}'
| true | true |
f7046405420ae2d8a151d553ced94b3545bdf702 | 1,204 | py | Python | Flask Server.py | Dropout1337/HWID-Authentication-API | f13c43bd2eba67b54c6902506c37cfc838400690 | [
"MIT"
] | 5 | 2020-10-26T08:37:19.000Z | 2021-07-19T20:05:52.000Z | Flask Server.py | bryonpokemon/HWID-Authentication-API | f13c43bd2eba67b54c6902506c37cfc838400690 | [
"MIT"
] | null | null | null | Flask Server.py | bryonpokemon/HWID-Authentication-API | f13c43bd2eba67b54c6902506c37cfc838400690 | [
"MIT"
] | 2 | 2021-02-11T16:13:04.000Z | 2021-02-23T05:38:41.000Z | import sqlite3
from flask import Flask, jsonify, request
app = Flask(__name__)
app.debug = True
api_key = "RANDOM ACCESS KEY HERE"
def CheckAPIKey(key):
if key == api_key:
return True
else:
return False
@app.route('/')
def HomeDir():
return jsonify({'msg': "invalid_endpoi... | 25.617021 | 62 | 0.549003 | import sqlite3
from flask import Flask, jsonify, request
app = Flask(__name__)
app.debug = True
api_key = "RANDOM ACCESS KEY HERE"
def CheckAPIKey(key):
if key == api_key:
return True
else:
return False
@app.route('/')
def HomeDir():
return jsonify({'msg': "invalid_endpoi... | true | true |
f70465ab09b7e3a8258fdf6aa11efa736b8d375d | 3,704 | py | Python | tfs_utils.py | ComposableAnalytics/ComposaPy | 6d82f8f953c709dde55e7f055e2f8b4e6765caba | [
"MIT"
] | null | null | null | tfs_utils.py | ComposableAnalytics/ComposaPy | 6d82f8f953c709dde55e7f055e2f8b4e6765caba | [
"MIT"
] | null | null | null | tfs_utils.py | ComposableAnalytics/ComposaPy | 6d82f8f953c709dde55e7f055e2f8b4e6765caba | [
"MIT"
] | null | null | null | import os
import shutil
import subprocess
from pathlib import Path
from dotenv import dotenv_values
COMPOSAPY_ROOT_DIR = Path(__file__).parent
COMP_APP_PROD_DIR = COMPOSAPY_ROOT_DIR.parent.parent.joinpath("Product")
DATALAB_SERVICE_STATIC_DIR = COMP_APP_PROD_DIR.joinpath(
"CompAnalytics.DataLabService", "static"
)... | 32.778761 | 90 | 0.661177 | import os
import shutil
import subprocess
from pathlib import Path
from dotenv import dotenv_values
COMPOSAPY_ROOT_DIR = Path(__file__).parent
COMP_APP_PROD_DIR = COMPOSAPY_ROOT_DIR.parent.parent.joinpath("Product")
DATALAB_SERVICE_STATIC_DIR = COMP_APP_PROD_DIR.joinpath(
"CompAnalytics.DataLabService", "static"
)... | true | true |
f7046658fdfdf7872253e0d7e2802b7a36defd45 | 1,995 | py | Python | chapter2/ridgeregress.py | DCtheTall/introduction-to-machine-learning | 636ec4733a504fe6798098d28337cf2088dcfce5 | [
"MIT"
] | 4 | 2018-09-21T17:15:19.000Z | 2022-03-17T23:25:18.000Z | chapter2/ridgeregress.py | DCtheTall/introduction-to-machine-learning | 636ec4733a504fe6798098d28337cf2088dcfce5 | [
"MIT"
] | null | null | null | chapter2/ridgeregress.py | DCtheTall/introduction-to-machine-learning | 636ec4733a504fe6798098d28337cf2088dcfce5 | [
"MIT"
] | null | null | null | """
Ridge regression
----------------
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import mglearn
from IPython.display import display
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split
from linregress import lr
# More on theory: https://en.wikip... | 33.25 | 79 | 0.729323 | """
Ridge regression
----------------
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import mglearn
from IPython.display import display
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split
from linregress import lr
X, y = mglearn.datasets.load_ex... | false | true |
f70467818a94eecac2a270341b4fa3d8b8a2193e | 5,565 | py | Python | sympy/functions/special/tests/test_gamma_functions.py | jegerjensen/sympy | 3a43310f1957a21a6f095fe2801cc05b5268a2c7 | [
"BSD-3-Clause"
] | 1 | 2016-07-13T04:30:25.000Z | 2016-07-13T04:30:25.000Z | sympy/functions/special/tests/test_gamma_functions.py | jegerjensen/sympy | 3a43310f1957a21a6f095fe2801cc05b5268a2c7 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/special/tests/test_gamma_functions.py | jegerjensen/sympy | 3a43310f1957a21a6f095fe2801cc05b5268a2c7 | [
"BSD-3-Clause"
] | null | null | null | from sympy import Symbol, gamma, oo, nan, zoo, factorial, sqrt, Rational, log,\
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin, cos, \
O, cancel
x = Symbol('x')
y = Symbol('y')
n = Symbol('n', integer=True)
def test_gamma():
assert gamma(nan) == nan
assert gamma(oo) == oo... | 36.372549 | 84 | 0.533513 | from sympy import Symbol, gamma, oo, nan, zoo, factorial, sqrt, Rational, log,\
polygamma, EulerGamma, pi, uppergamma, S, expand_func, loggamma, sin, cos, \
O, cancel
x = Symbol('x')
y = Symbol('y')
n = Symbol('n', integer=True)
def test_gamma():
assert gamma(nan) == nan
assert gamma(oo) == oo... | true | true |
f7046789ac98fa4ab8bea3ee65dae91d7e9edde9 | 1,413 | py | Python | search_engine/pods/splitter.py | Alea4jacta6est/transformers-for-lawyers | 3a4888617b89b4ae0fddb4cb69e924106eaea4cd | [
"Apache-2.0"
] | null | null | null | search_engine/pods/splitter.py | Alea4jacta6est/transformers-for-lawyers | 3a4888617b89b4ae0fddb4cb69e924106eaea4cd | [
"Apache-2.0"
] | null | null | null | search_engine/pods/splitter.py | Alea4jacta6est/transformers-for-lawyers | 3a4888617b89b4ae0fddb4cb69e924106eaea4cd | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from typing import Dict
import re
import string
from jina.hub.crafters.nlp.Sentencizer import Sentencizer
import pickle
# class Splitter(Sentencizer):
# count = 0
# separator = "|"
#
# def __init__(self,... | 30.06383 | 78 | 0.551309 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from typing import Dict
import re
import string
from jina.hub.crafters.nlp.Sentencizer import Sentencizer
import pickle
class SentenceSplitter(Sentencizer):
count = 0
separator = "|"
def __i... | true | true |
f70467b0bd0971bb7dfa116b96c50c60140e0b94 | 8,598 | py | Python | apps/jetbrains/jetbrains.py | SeanTaylorLane/knausj_talon | 26ea2a9078a3dff4e0941293b4c70e40b849aa1a | [
"MIT"
] | 2 | 2021-02-10T00:06:28.000Z | 2021-03-19T22:12:54.000Z | apps/jetbrains/jetbrains.py | SeanTaylorLane/knausj_talon | 26ea2a9078a3dff4e0941293b4c70e40b849aa1a | [
"MIT"
] | null | null | null | apps/jetbrains/jetbrains.py | SeanTaylorLane/knausj_talon | 26ea2a9078a3dff4e0941293b4c70e40b849aa1a | [
"MIT"
] | null | null | null | import os
import os.path
import requests
import time
from pathlib import Path
from talon import ctrl, ui, Module, Context, actions, clip
import tempfile
# Courtesy of https://github.com/anonfunc/talon-user/blob/master/apps/jetbrains.py
extendCommands = []
# Each IDE gets its own port, as otherwise you wouldn't be ab... | 28.098039 | 87 | 0.646778 | import os
import os.path
import requests
import time
from pathlib import Path
from talon import ctrl, ui, Module, Context, actions, clip
import tempfile
extendCommands = []
# to run two at the same time and switch between them.
# Note that MPS and IntelliJ ultimate will conflict...
port_mapping = {
"com.google... | true | true |
f704685df711b41023f741190aba21f6adde2272 | 1,194 | py | Python | docs/_downloads/e0051c6e37b730111a06abd85529e288/plot__2d_distributions.py | IKupriyanov-HORIS/lets-plot-docs | 30fd31cb03dc649a03518b0c9348639ebfe09d53 | [
"MIT"
] | null | null | null | docs/_downloads/e0051c6e37b730111a06abd85529e288/plot__2d_distributions.py | IKupriyanov-HORIS/lets-plot-docs | 30fd31cb03dc649a03518b0c9348639ebfe09d53 | [
"MIT"
] | null | null | null | docs/_downloads/e0051c6e37b730111a06abd85529e288/plot__2d_distributions.py | IKupriyanov-HORIS/lets-plot-docs | 30fd31cb03dc649a03518b0c9348639ebfe09d53 | [
"MIT"
] | null | null | null | """
2D Distributions
================
Some plots visualize a transformation of the original data set. Use a
stat parameter to choose a common transformation to visualize.
Each stat creates additional variables to map aesthetics to. These
variables use a common ..name.. syntax.
Look at the examples... | 29.121951 | 99 | 0.662479 | df = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv')
w, h = 400, 300
p = ggplot(df, aes('cty', 'hwy')) + ggsize(w, h)
p11 = p + geom_bin2d() + ggtitle('geom="bin2d" + default stat')
p12 = p + geom_point(aes(color='..count..'), stat='bin2d', size=3, shape=15) + \
... | true | true |
f7046953dd226ba1a98810d21ebff8d1f0b9194a | 567 | py | Python | rxbp/indexed/impl/indexedsharedflowableimpl.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 24 | 2018-11-22T21:04:49.000Z | 2021-11-08T11:18:09.000Z | rxbp/indexed/impl/indexedsharedflowableimpl.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 1 | 2019-02-06T15:58:46.000Z | 2019-02-12T20:31:50.000Z | rxbp/indexed/impl/indexedsharedflowableimpl.py | MichaelSchneeberger/rx_backpressure | 16173827498bf1bbee3344933cb9efbfd19699f5 | [
"Apache-2.0"
] | 1 | 2021-01-26T12:41:37.000Z | 2021-01-26T12:41:37.000Z | from dataclasses import replace
from dataclass_abc import dataclass_abc
from rxbp.indexed.indexedflowable import IndexedFlowable
from rxbp.indexed.indexedsharedflowable import IndexedSharedFlowable
from rxbp.indexed.mixins.indexedflowablemixin import IndexedFlowableMixin
from rxbp.typing import ValueType
@dataclass... | 27 | 73 | 0.767196 | from dataclasses import replace
from dataclass_abc import dataclass_abc
from rxbp.indexed.indexedflowable import IndexedFlowable
from rxbp.indexed.indexedsharedflowable import IndexedSharedFlowable
from rxbp.indexed.mixins.indexedflowablemixin import IndexedFlowableMixin
from rxbp.typing import ValueType
@dataclass... | true | true |
f70469ec382f6f990ad177997059ee18b7c599d0 | 5,084 | py | Python | AlphaFold-local.py | Hanhui-Ma-Lab/ColabFold-in-local | 29a9d2f318cf781855186788127f484e4c7ee014 | [
"MIT"
] | null | null | null | AlphaFold-local.py | Hanhui-Ma-Lab/ColabFold-in-local | 29a9d2f318cf781855186788127f484e4c7ee014 | [
"MIT"
] | null | null | null | AlphaFold-local.py | Hanhui-Ma-Lab/ColabFold-in-local | 29a9d2f318cf781855186788127f484e4c7ee014 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
#@title Input protein sequence(s), then hit `Runtime` -> `Run all`
#from google.colab import files
import os.path
import re
import hashlib
import random
def add_hash(x,y):
return x+"_"+hashlib.sha1(y.encode()).hexdigest()[:5]
with open("protein") as f:
query_... | 33.228758 | 198 | 0.700826 |
import os.path
import re
import hashlib
import random
def add_hash(x,y):
return x+"_"+hashlib.sha1(y.encode()).hexdigest()[:5]
with open("protein") as f:
query_sequence = f.read()
.join(query_sequence.split())
jobname = 'test'
basejobname = "".join(jobname.split())
basejobname = re.sub(r'\W+', '',... | true | true |
f7046a03c0614c97a9a030f915cc1c8be81beed6 | 112,252 | py | Python | src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | taliesins/azure-cli | a2451fe7148dfdd005f0f2ec797915eb479f6f6a | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | taliesins/azure-cli | a2451fe7148dfdd005f0f2ec797915eb479f6f6a | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | taliesins/azure-cli | a2451fe7148dfdd005f0f2ec797915eb479f6f6a | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.907937 | 316 | 0.566974 |
import time
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.core.util import CLIError
from azure.cli.testsdk.base import execute
from azure.cli.testsdk.exceptions import CliTestError
from azure.cli.testsdk import (
JMESPathCheck,
JMESPathCheckExists,
JMESPathCheckGreaterTh... | true | true |
f7046ad2b8cb669f0628dd88fdf37467b4f25888 | 71 | py | Python | app/grandchallenge/evaluation/__init__.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | 1 | 2021-02-09T10:30:44.000Z | 2021-02-09T10:30:44.000Z | app/grandchallenge/evaluation/__init__.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/evaluation/__init__.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | null | null | null | default_app_config = "grandchallenge.evaluation.apps.EvaluationConfig"
| 35.5 | 70 | 0.873239 | default_app_config = "grandchallenge.evaluation.apps.EvaluationConfig"
| true | true |
f7046bf62b21b53ac62565c24e9af84db51764a3 | 96 | py | Python | src/_stories_pytest/exceptions.py | proofit404/stories-pytest | e20a50afa42740e2bf0a19219853fcc3c33f0c15 | [
"BSD-2-Clause"
] | null | null | null | src/_stories_pytest/exceptions.py | proofit404/stories-pytest | e20a50afa42740e2bf0a19219853fcc3c33f0c15 | [
"BSD-2-Clause"
] | 10 | 2020-12-04T17:37:51.000Z | 2021-03-24T23:45:36.000Z | src/_stories_pytest/exceptions.py | proofit404/stories-pytest | e20a50afa42740e2bf0a19219853fcc3c33f0c15 | [
"BSD-2-Clause"
] | null | null | null | class StoryPytestError(Exception):
"""Base error of all stories-pytest errors."""
pass
| 19.2 | 50 | 0.697917 | class StoryPytestError(Exception):
pass
| true | true |
f7046dbb7f887b37bfad4faac3dc69cb9c0b4057 | 6,387 | py | Python | mezzanine/twitter/models.py | ShAlireza/mezzanine | 365b3e3251f341f7337f79838796112f84ab94ad | [
"BSD-2-Clause"
] | 6 | 2019-11-22T10:27:57.000Z | 2020-07-21T22:55:20.000Z | mezzanine/twitter/models.py | ShAlireza/mezzanine | 365b3e3251f341f7337f79838796112f84ab94ad | [
"BSD-2-Clause"
] | 7 | 2020-02-11T09:08:59.000Z | 2020-07-23T12:55:44.000Z | mezzanine/twitter/models.py | cjh79/mezzanine | 37712f1a1023ac0ee7e2114ac4262cedfd7f4556 | [
"BSD-2-Clause"
] | 6 | 2019-12-13T12:58:21.000Z | 2021-01-25T03:07:50.000Z | from datetime import datetime
import re
from urllib.parse import quote
from django.db import models
from django.utils.html import urlize
from django.utils.timezone import make_aware, utc
from django.utils.translation import ugettext_lazy as _
from requests_oauthlib import OAuth1
import requests
from mezzanine.conf i... | 38.017857 | 87 | 0.60357 | from datetime import datetime
import re
from urllib.parse import quote
from django.db import models
from django.utils.html import urlize
from django.utils.timezone import make_aware, utc
from django.utils.translation import ugettext_lazy as _
from requests_oauthlib import OAuth1
import requests
from mezzanine.conf i... | true | true |
f7046e1e1a9b15939c75dcbbfdbd3f1d4241b414 | 1,453 | py | Python | carfinder/urls.py | kbradle/CarFinder | d4855fd996219da593ec0612f53e6cf0c75519c5 | [
"MIT"
] | null | null | null | carfinder/urls.py | kbradle/CarFinder | d4855fd996219da593ec0612f53e6cf0c75519c5 | [
"MIT"
] | 7 | 2021-03-30T13:57:44.000Z | 2021-09-22T19:22:13.000Z | carfinder/urls.py | GaboxFH/cis4930-carfinder | 28f0933ffdfede6a4008dba37deaf78ded5d4194 | [
"MIT"
] | null | null | null | """carfinder URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 41.514286 | 77 | 0.741913 | from django.contrib import admin
from django.urls import path
from finder import views
from finder import forms
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls import include, url, handler404
from django.views.generic.base import TemplateView
index = views.Index()
ur... | true | true |
f7046e6627a6ca83d314b818f0fbf04dddf2131d | 3,669 | py | Python | jaseci_serv/jaseci_serv/jac_api/views.py | ChrisIsKing/jaseci | 0495cb5aed77d563213943a2090de4255241b78c | [
"MIT"
] | null | null | null | jaseci_serv/jaseci_serv/jac_api/views.py | ChrisIsKing/jaseci | 0495cb5aed77d563213943a2090de4255241b78c | [
"MIT"
] | null | null | null | jaseci_serv/jaseci_serv/jac_api/views.py | ChrisIsKing/jaseci | 0495cb5aed77d563213943a2090de4255241b78c | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from knox.auth import TokenAuthentication
from rest_framework.permissions import IsAdminUser, IsAuthenticated, AllowAny
from rest_framework.response import Response
from jaseci.utils.utils import logger
from jaseci.api.public_api import public_api
from jaseci.element.element imp... | 33.054054 | 77 | 0.652766 | from rest_framework.views import APIView
from knox.auth import TokenAuthentication
from rest_framework.permissions import IsAdminUser, IsAuthenticated, AllowAny
from rest_framework.response import Response
from jaseci.utils.utils import logger
from jaseci.api.public_api import public_api
from jaseci.element.element imp... | true | true |
f7046ef62710277003771189a7a23755341e00eb | 5,686 | py | Python | hookah/dispatch.py | dustin/hookah | 596239af24b53e8a64472cb6da84a9a97332e01d | [
"MIT"
] | 1 | 2015-11-04T10:32:24.000Z | 2015-11-04T10:32:24.000Z | hookah/dispatch.py | dustin/hookah | 596239af24b53e8a64472cb6da84a9a97332e01d | [
"MIT"
] | null | null | null | hookah/dispatch.py | dustin/hookah | 596239af24b53e8a64472cb6da84a9a97332e01d | [
"MIT"
] | null | null | null | from twisted.internet import reactor
from twisted.web import client, error, http
from twisted.web.resource import Resource
from hookah import queue
import urllib
import sys, os
from urllib import unquote
import cgi
import StringIO
import mimetools
import mimetypes
# TODO: Make these configurable
RETRIES = 3
DELAY_MUL... | 36.216561 | 133 | 0.602884 | from twisted.internet import reactor
from twisted.web import client, error, http
from twisted.web.resource import Resource
from hookah import queue
import urllib
import sys, os
from urllib import unquote
import cgi
import StringIO
import mimetools
import mimetypes
RETRIES = 3
DELAY_MULTIPLIER = 5
def decode_multipa... | false | true |
f7046f7f477c957cbd276dfb161bc2b508dcad64 | 714 | py | Python | Author/migrations/0002_initial.py | CMPUT404-Fa21-Organization/CMPUT404-Project-Social-Distribution | 63c0ba2a03f0b462e3673ce7a4bf6bae7999440c | [
"Apache-2.0"
] | 3 | 2021-12-11T13:43:56.000Z | 2022-03-31T02:36:05.000Z | Author/migrations/0002_initial.py | CMPUT404-Fa21-Organization/CMPUT404-Project-Social-Distribution | 63c0ba2a03f0b462e3673ce7a4bf6bae7999440c | [
"Apache-2.0"
] | 9 | 2021-10-01T22:46:57.000Z | 2021-12-16T18:01:31.000Z | Author/migrations/0002_initial.py | CMPUT404-Fa21-Organization/CMPUT404-Project-Social-Distribution | 63c0ba2a03f0b462e3673ce7a4bf6bae7999440c | [
"Apache-2.0"
] | 2 | 2021-12-16T16:37:10.000Z | 2021-12-16T20:30:12.000Z | # Generated by Django 3.2.7 on 2021-12-02 21:01
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('Author', '0001_initial'),
('Posts', '0001_initial'),
]
operations = [
migration... | 25.5 | 118 | 0.603641 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('Author', '0001_initial'),
('Posts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='inbox',
... | true | true |
f7046f8691fd007d37014cd2211e82ad6141f5c5 | 1,700 | py | Python | src/Products/PluginIndexes/util.py | icemac/Products.ZCatalog | 697719cc0f1a016ab7b874237271d3e11693e78b | [
"ZPL-2.1"
] | null | null | null | src/Products/PluginIndexes/util.py | icemac/Products.ZCatalog | 697719cc0f1a016ab7b874237271d3e11693e78b | [
"ZPL-2.1"
] | 1 | 2021-02-10T16:05:38.000Z | 2021-02-10T16:05:38.000Z | src/Products/PluginIndexes/util.py | icemac/Products.ZCatalog | 697719cc0f1a016ab7b874237271d3e11693e78b | [
"ZPL-2.1"
] | 1 | 2021-02-10T15:34:58.000Z | 2021-02-10T15:34:58.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 28.813559 | 78 | 0.606471 | true | true | |
f7046f9e665ec3601cd231ce9dc0a84025a8f89a | 7,988 | py | Python | generateFullDataset.py | Elucidation/ChessboardDetect | a5d2a2c2ab2434e4e041b4f384f3cd7d6884d2c4 | [
"MIT"
] | 43 | 2016-10-28T02:13:26.000Z | 2022-02-16T14:20:32.000Z | generateFullDataset.py | AnkaChan/ChessboardDetect | a5d2a2c2ab2434e4e041b4f384f3cd7d6884d2c4 | [
"MIT"
] | 3 | 2016-11-15T19:04:46.000Z | 2020-08-26T20:41:29.000Z | generateFullDataset.py | AnkaChan/ChessboardDetect | a5d2a2c2ab2434e4e041b4f384f3cd7d6884d2c4 | [
"MIT"
] | 12 | 2018-08-22T22:33:21.000Z | 2021-08-20T08:40:42.000Z | # Given a list of pts text files, build a complete dataset from it.
import glob
import os
import PIL.Image
import cv2
import numpy as np
from time import time
from argparse import ArgumentParser
from scipy.spatial import cKDTree
import tensorflow as tf
import SaddlePoints
import errno
def mkdir_p(path):
try:
os.... | 36.474886 | 107 | 0.654482 |
import glob
import os
import PIL.Image
import cv2
import numpy as np
from time import time
from argparse import ArgumentParser
from scipy.spatial import cKDTree
import tensorflow as tf
import SaddlePoints
import errno
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if os.path.isdir(path... | true | true |
f7046fced270fd94b0b99622ee7c5cf77efa18d6 | 984 | py | Python | q1.py | lilimonroy/CrashCourseOnPython-Functions | 9a1837faabda10036c5b5ba0e228c3fff695f92b | [
"MIT"
] | null | null | null | q1.py | lilimonroy/CrashCourseOnPython-Functions | 9a1837faabda10036c5b5ba0e228c3fff695f92b | [
"MIT"
] | null | null | null | q1.py | lilimonroy/CrashCourseOnPython-Functions | 9a1837faabda10036c5b5ba0e228c3fff695f92b | [
"MIT"
] | null | null | null | # Question 1
# This function converts miles to kilometers (km).
# Complete the function to return the result of the conversion
# Call the function to convert the trip distance from miles to kilometers
# Fill in the blank to print the result of the conversion
# Calculate the round-trip in kilometers ... | 36.444444 | 109 | 0.75 |
def convert_distance(miles):
km = miles * 1.6
return km
my_trip_miles = 55
my_trip_km = convert_distance(my_trip_miles)
print("The distance in kilometers is " + str(my_trip_km))
print("The round-trip in kilometers is " + str(my_trip_km * 2))
| true | true |
f7047041ce1f0b682dbe2f63380a8cd059b3a562 | 4,447 | py | Python | voltDivMultEnumAlternate.py | li-el/CS190IFinal | 85f7fca739f326009e86f699c5a88ca72ac8d346 | [
"Apache-2.0"
] | null | null | null | voltDivMultEnumAlternate.py | li-el/CS190IFinal | 85f7fca739f326009e86f699c5a88ca72ac8d346 | [
"Apache-2.0"
] | null | null | null | voltDivMultEnumAlternate.py | li-el/CS190IFinal | 85f7fca739f326009e86f699c5a88ca72ac8d346 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import tyrell.spec as Stuff
from tyrell.interpreter import PostOrderInterpreter
from tyrell.enumerator import SmtEnumerator, RelaxedRandomEnumerator
from tyrell.decider import Example, ExampleConstraintDecider, SimpleSpiceDecider, ExampleConstraintPruningDecider
from tyrell.synthesizer import Syn... | 28.876623 | 113 | 0.598381 |
import tyrell.spec as Stuff
from tyrell.interpreter import PostOrderInterpreter
from tyrell.enumerator import SmtEnumerator, RelaxedRandomEnumerator
from tyrell.decider import Example, ExampleConstraintDecider, SimpleSpiceDecider, ExampleConstraintPruningDecider
from tyrell.synthesizer import Synthesizer
from tyrell.... | true | true |
f70470a021e7886a90ec6d4acdea4913f2888bf5 | 903 | py | Python | src/managementgroups/azext_managementgroups/_client_factory.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/managementgroups/azext_managementgroups/_client_factory.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/managementgroups/azext_managementgroups/_client_factory.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2018-03-20T23:36:57.000Z | 2018-03-20T23:36:57.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.045455 | 94 | 0.636766 |
def cf_managementgroups(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_managementgroups.managementgroups import ManagementGroupsAPI
return get_mgmt_service_client(
cli_ctx,
ManagementGroupsAPI,
subscription_bound=False)
de... | true | true |
f704723d6929ca884f25e6f71988aa0e3ed05db5 | 7,607 | py | Python | funcsim/distfit.py | h-bryant/funcsim | 6f0ec2365e3ed6d9478e2f92e755cebafaf6528d | [
"BSD-3-Clause"
] | 1 | 2021-12-08T03:40:26.000Z | 2021-12-08T03:40:26.000Z | funcsim/distfit.py | h-bryant/funcsim | 6f0ec2365e3ed6d9478e2f92e755cebafaf6528d | [
"BSD-3-Clause"
] | null | null | null | funcsim/distfit.py | h-bryant/funcsim | 6f0ec2365e3ed6d9478e2f92e755cebafaf6528d | [
"BSD-3-Clause"
] | null | null | null |
import scipy.stats as stats
import numpy as np
import warnings
from ecdfgof import adtest, kstest
warnings.filterwarnings("ignore")
_long = [
("alpha", stats.alpha),
("anglit", stats.anglit),
("arcsine", stats.arcsine),
("argus", ... | 41.342391 | 80 | 0.449717 |
import scipy.stats as stats
import numpy as np
import warnings
from ecdfgof import adtest, kstest
warnings.filterwarnings("ignore")
_long = [
("alpha", stats.alpha),
("anglit", stats.anglit),
("arcsine", stats.arcsine),
("argus", ... | true | true |
f70473ea6441fff256a9b280f85e65dbc8390f66 | 1,683 | py | Python | projects/balancer/tests/test_erc_20_recover.py | Lido-Finance/rewards-managers | 9672cc7fbb7162ae5d84ffa395a4611f19d76eee | [
"MIT"
] | 2 | 2021-09-15T04:39:25.000Z | 2021-10-30T04:38:54.000Z | projects/balancer/tests/test_erc_20_recover.py | lidofinance/rewards-manager | 8f564c96bbca9ef9a06b5624c723429fd3558f58 | [
"MIT"
] | null | null | null | projects/balancer/tests/test_erc_20_recover.py | lidofinance/rewards-manager | 8f564c96bbca9ef9a06b5624c723429fd3558f58 | [
"MIT"
] | 1 | 2022-03-31T14:26:28.000Z | 2022-03-31T14:26:28.000Z | import pytest
from brownie import interface, RewardsManager, Contract
from utils.voting import create_vote
from utils.config import (lido_dao_voting_address,
lido_dao_agent_address,
balancer_deployed_manager,
lido_dao_token_manager_address,... | 44.289474 | 121 | 0.716578 | import pytest
from brownie import interface, RewardsManager, Contract
from utils.voting import create_vote
from utils.config import (lido_dao_voting_address,
lido_dao_agent_address,
balancer_deployed_manager,
lido_dao_token_manager_address,... | true | true |
f7047481a9d2819da9f6c9b3f58dbab818ee24c6 | 550 | py | Python | line_follow/motor.py | ryentran/roadster | 33307cc8f6707d95c7a0b3804975e4628d27e91f | [
"MIT"
] | null | null | null | line_follow/motor.py | ryentran/roadster | 33307cc8f6707d95c7a0b3804975e4628d27e91f | [
"MIT"
] | null | null | null | line_follow/motor.py | ryentran/roadster | 33307cc8f6707d95c7a0b3804975e4628d27e91f | [
"MIT"
] | 1 | 2020-03-07T21:52:32.000Z | 2020-03-07T21:52:32.000Z | import RPi.GPIO as GPIO
import time
HIN = 8
LIN = 10
freq = 500
class Motor:
def __init__(self, HIN=HIN, LIN=LIN, freq=freq):
GPIO.setmode(GPIO.BOARD)
GPIO.setup(HIN, GPIO.OUT)
GPIO.setup(LIN, GPIO.OUT)
self.high = GPIO.PWM(HIN, freq)
self.low = GPIO.PWM(LIN, freq... | 21.153846 | 52 | 0.538182 | import RPi.GPIO as GPIO
import time
HIN = 8
LIN = 10
freq = 500
class Motor:
def __init__(self, HIN=HIN, LIN=LIN, freq=freq):
GPIO.setmode(GPIO.BOARD)
GPIO.setup(HIN, GPIO.OUT)
GPIO.setup(LIN, GPIO.OUT)
self.high = GPIO.PWM(HIN, freq)
self.low = GPIO.PWM(LIN, freq... | true | true |
f70474925eb078c598d03d4255e4e76e7b6c9361 | 420 | py | Python | examples/function_examples/bpod_info.py | ckarageorgkaneen/pybpod-api | ebccef800ae1abf3b6a643ff33166fab2096c780 | [
"MIT"
] | 1 | 2021-01-18T08:18:22.000Z | 2021-01-18T08:18:22.000Z | examples/function_examples/bpod_info.py | ckarageorgkaneen/pybpod-api | ebccef800ae1abf3b6a643ff33166fab2096c780 | [
"MIT"
] | 1 | 2020-09-18T20:46:11.000Z | 2020-12-29T14:55:20.000Z | examples/function_examples/bpod_info.py | ckarageorgkaneen/pybpod-api | ebccef800ae1abf3b6a643ff33166fab2096c780 | [
"MIT"
] | 3 | 2020-09-12T15:32:11.000Z | 2022-03-11T23:08:03.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Get hardware info from Bpod
"""
from pybpodapi.protocol import Bpod
from confapp import conf
my_bpod = Bpod()
my_bpod.close()
print("Target Bpod firmware version: ", conf.TARGET_BPOD_FIRMWARE_VERSION)
print("Firmware version (read from device): ", my_bpod.hardware.... | 21 | 81 | 0.742857 |
from pybpodapi.protocol import Bpod
from confapp import conf
my_bpod = Bpod()
my_bpod.close()
print("Target Bpod firmware version: ", conf.TARGET_BPOD_FIRMWARE_VERSION)
print("Firmware version (read from device): ", my_bpod.hardware.firmware_version)
print("Machine type version (read from device): ", my_bpod.ha... | true | true |
f704749725612792a6604ef0c554fbed25fdcc14 | 869 | py | Python | storages/dynamodb.py | cofablab/tokenscan | a5e749c94b644b02ecdc6c11e301408500e3a155 | [
"MIT"
] | 3 | 2018-08-13T09:36:57.000Z | 2022-03-29T05:10:15.000Z | storages/dynamodb.py | cofablab/tokenscan | a5e749c94b644b02ecdc6c11e301408500e3a155 | [
"MIT"
] | null | null | null | storages/dynamodb.py | cofablab/tokenscan | a5e749c94b644b02ecdc6c11e301408500e3a155 | [
"MIT"
] | 4 | 2018-09-16T08:02:49.000Z | 2020-10-14T11:37:24.000Z | import boto3
class DynamoDB(object):
def __init__(self, table_name):
self.resource = self._resource()
self.client = self._client()
self.table = self.resource.Table(table_name)
self.table_name = table_name
def _resource(self):
return boto3.resource('dynamodb')
def ... | 28.966667 | 60 | 0.631761 | import boto3
class DynamoDB(object):
def __init__(self, table_name):
self.resource = self._resource()
self.client = self._client()
self.table = self.resource.Table(table_name)
self.table_name = table_name
def _resource(self):
return boto3.resource('dynamodb')
def ... | true | true |
f704753b2aeca212b08faa33dbb2af98cfeaaeb2 | 74,031 | py | Python | DataDictionary.py | masthan549/RCT_TAXIBOT_ASSYSTEM | d896cdb2422828601170e42a91b88bbc52a80fd6 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | DataDictionary.py | masthan549/RCT_TAXIBOT_ASSYSTEM | d896cdb2422828601170e42a91b88bbc52a80fd6 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | DataDictionary.py | masthan549/RCT_TAXIBOT_ASSYSTEM | d896cdb2422828601170e42a91b88bbc52a80fd6 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null |
CCSettingsList = {'Simulink.SolverCC' : # Solver
{
'StartTime' : '0.0',
'StopTime' : 'inf',
'SolverMode' : 'SingleTasking',
'Solver' : 'FixedStepDiscrete'... | 71.666021 | 342 | 0.355783 |
CCSettingsList = {'Simulink.SolverCC' :
{
'StartTime' : '0.0',
'StopTime' : 'inf',
'SolverMode' : 'SingleTasking',
'Solver' : 'FixedStepDiscrete',
... | true | true |
f70475a66adf7de764353f9030c7c39a6130ac52 | 4,512 | py | Python | main.py | Sofa4/PyTeleBot | 00edbfdb2f74b58ce4f1c427a48c3c94cfba8c5f | [
"MIT"
] | null | null | null | main.py | Sofa4/PyTeleBot | 00edbfdb2f74b58ce4f1c427a48c3c94cfba8c5f | [
"MIT"
] | null | null | null | main.py | Sofa4/PyTeleBot | 00edbfdb2f74b58ce4f1c427a48c3c94cfba8c5f | [
"MIT"
] | null | null | null | # Телеграм-бот v.002 - бот создаёт меню, присылает собачку, и анекдот
import telebot # pyTelegramBotAPI 4.3.1
from telebot import types
import requests
import bs4
bot = telebot.TeleBot('5105972662:AAG24fr382U1_hosO4Zrb-tv_BTakAV1MPk') # Создаем экземпляр бота
# --------------------------------------------... | 50.696629 | 121 | 0.513076 |
import telebot
from telebot import types
import requests
import bs4
bot = telebot.TeleBot('5105972662:AAG24fr382U1_hosO4Zrb-tv_BTakAV1MPk')
@bot.message_handler(commands=["start"])
def start(message, res=False):
chat_id = message.chat.id
markup = types.ReplyKeyboardMarkup(resize_keyboard=Tr... | true | true |
f70475e8e3439802796c121305bf88eaa01b7b5e | 45,252 | py | Python | build/lib/SWaN_accel/classify.py | binodthapachhetry/SWaN | df54f72dfbd10bb67d3bed2cd20f3401eb779d50 | [
"MIT"
] | null | null | null | build/lib/SWaN_accel/classify.py | binodthapachhetry/SWaN | df54f72dfbd10bb67d3bed2cd20f3401eb779d50 | [
"MIT"
] | null | null | null | build/lib/SWaN_accel/classify.py | binodthapachhetry/SWaN | df54f72dfbd10bb67d3bed2cd20f3401eb779d50 | [
"MIT"
] | null | null | null | import os, gzip, pickle, sys, datetime, struct
from glob import glob
import pandas as pd
import subprocess
import shutil
import numpy as np
from datetime import timedelta
from io import StringIO
from SWaN_accel import config
from SWaN_accel import utils
from SWaN_accel import feature_set
pd.options.mode.chained_assign... | 45.894523 | 154 | 0.575356 | import os, gzip, pickle, sys, datetime, struct
from glob import glob
import pandas as pd
import subprocess
import shutil
import numpy as np
from datetime import timedelta
from io import StringIO
from SWaN_accel import config
from SWaN_accel import utils
from SWaN_accel import feature_set
pd.options.mode.chained_assign... | true | true |
f70476060d68ffc13432e8929b4d6ac973cd17fa | 12,688 | py | Python | store/adminshop/models/tienda.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | store/adminshop/models/tienda.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | store/adminshop/models/tienda.py | vallemrv/my_store_test | 2da624fd02c5f1784464f15b751b488f3dd2bae6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 28-Aug-2017
# @Email: valle.mrv@gmail.com
# @Filename: models.py
# @Last modified by: valle
# @Last modified time: 15-Feb-2018
# @License: Apache license vesion 2.0
from __future__ import unicode_literals
from django.db.models import Q
from dj... | 34.761644 | 106 | 0.595287 |
from __future__ import unicode_literals
from django.db.models import Q
from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
from adminshop.models import (Clientes, Direcciones, Proveedores,
Productos, Presupuesto)
CHOICES_TIPO_... | true | true |
f70476ec118903d398176eba5bc0ad6c7ca1ea45 | 4,104 | py | Python | tests/unit/dataactvalidator/test_fabs42_detached_award_financial_assistance_1.py | brianherman/data-act-broker-backend | 80eb055b9d245046192f7ad4fd0be7d0e11d2dec | [
"CC0-1.0"
] | null | null | null | tests/unit/dataactvalidator/test_fabs42_detached_award_financial_assistance_1.py | brianherman/data-act-broker-backend | 80eb055b9d245046192f7ad4fd0be7d0e11d2dec | [
"CC0-1.0"
] | 3 | 2021-08-22T11:47:45.000Z | 2022-03-29T22:06:49.000Z | tests/unit/dataactvalidator/test_fabs42_detached_award_financial_assistance_1.py | brianherman/data-act-broker-backend | 80eb055b9d245046192f7ad4fd0be7d0e11d2dec | [
"CC0-1.0"
] | 1 | 2020-07-17T23:50:56.000Z | 2020-07-17T23:50:56.000Z | from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs42_detached_award_financial_assistance_1'
def test_column_headers(database):
expected_subset = {'row_number', 'place_of_performan... | 66.193548 | 118 | 0.596491 | from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs42_detached_award_financial_assistance_1'
def test_column_headers(database):
expected_subset = {'row_number', 'place_of_performan... | true | true |
f70478037dd14969e2bce3472f65854a51d7a0f9 | 5,971 | py | Python | img/AImap.py | MenakaRevel/HydroDA | 530165a38c70241c86cf73d434f2a74cb7c1cd7b | [
"MIT"
] | 2 | 2021-01-19T08:53:16.000Z | 2022-01-03T00:59:47.000Z | img/AImap.py | MenakaRevel/HydroDA | 530165a38c70241c86cf73d434f2a74cb7c1cd7b | [
"MIT"
] | null | null | null | img/AImap.py | MenakaRevel/HydroDA | 530165a38c70241c86cf73d434f2a74cb7c1cd7b | [
"MIT"
] | null | null | null | #!/opt/local/bin/pyuhon
#-*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import datetime
from matplotlib.colors import LogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.cm as cm
import sys
from mpl_toolkits.basemap import Basemap
import os
import calendar
#as... | 34.715116 | 160 | 0.628538 |
import numpy as np
import matplotlib.pyplot as plt
import datetime
from matplotlib.colors import LogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.cm as cm
import sys
from mpl_toolkits.basemap import Basemap
import os
import calendar
os.system("ln -sf ../gosh/params.py params.... | false | true |
f70478107ea5e3ea6df2cd35473e2a0f32e62008 | 5,570 | py | Python | pulser/channels.py | Yash-10/Pulser | afd16e0789b2621f00f6661df6d33ff27c44ac94 | [
"Apache-2.0"
] | null | null | null | pulser/channels.py | Yash-10/Pulser | afd16e0789b2621f00f6661df6d33ff27c44ac94 | [
"Apache-2.0"
] | null | null | null | pulser/channels.py | Yash-10/Pulser | afd16e0789b2621f00f6661df6d33ff27c44ac94 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pulser Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 36.405229 | 79 | 0.636984 |
from dataclasses import dataclass
from typing import ClassVar
import warnings
@dataclass(init=False, repr=False, frozen=True)
class Channel:
name: ClassVar[str]
basis: ClassVar[str]
addressing: str
max_abs_detuning: float
max_amp: float
retarget_time: int = None
max_targets:... | true | true |
f704795399b1cbe7ca42cc6b562a3ee519d772b4 | 4,825 | py | Python | cheddargorge/wordrelaygame/views.py | SteveWooding/cheddar-gorge | 6f99601d0534771e1fa2c41d8a6fcc8791de96e3 | [
"MIT"
] | null | null | null | cheddargorge/wordrelaygame/views.py | SteveWooding/cheddar-gorge | 6f99601d0534771e1fa2c41d8a6fcc8791de96e3 | [
"MIT"
] | null | null | null | cheddargorge/wordrelaygame/views.py | SteveWooding/cheddar-gorge | 6f99601d0534771e1fa2c41d8a6fcc8791de96e3 | [
"MIT"
] | null | null | null | """Views for the wordrelaygame app."""
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.views.generic import View, DetailView, ListView
from .forms import WordForm
from .models import Story
class HomeView(DetailView... | 34.71223 | 82 | 0.607668 | from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render
from django.views.generic import View, DetailView, ListView
from .forms import WordForm
from .models import Story
class HomeView(DetailView):
context_object_name = 'latest_st... | true | true |
f7047a75f797dfcf58fe568e7dd9f534ae570743 | 1,150 | py | Python | diags/userTime.py | Flakebi/ts3stats | d8ee1def4323c9ce1c9b88c6c22e0ff73651f46b | [
"Apache-2.0",
"MIT"
] | 9 | 2017-11-17T17:13:52.000Z | 2020-10-04T22:20:07.000Z | diags/userTime.py | Flakebi/ts3stats | d8ee1def4323c9ce1c9b88c6c22e0ff73651f46b | [
"Apache-2.0",
"MIT"
] | 1 | 2018-08-06T11:02:39.000Z | 2018-08-12T14:52:14.000Z | diags/userTime.py | ReSpeak/ts3stats | d8ee1def4323c9ce1c9b88c6c22e0ff73651f46b | [
"Apache-2.0",
"MIT"
] | 3 | 2020-10-18T16:05:29.000Z | 2021-09-12T11:45:36.000Z | from CreateTimeGraphs import *
def create_diag(dc):
"""Time spent on TeamSpeak per user"""
globalTime = timedelta()
for u in dc.users:
# Time in seconds
u.time = timedelta()
for con in u.connections:
# Increase connected time
u.time += con.duration()
us = sorted(dc.users, key = lambda u: -u.time)
for ... | 28.04878 | 93 | 0.676522 | from CreateTimeGraphs import *
def create_diag(dc):
globalTime = timedelta()
for u in dc.users:
u.time = timedelta()
for con in u.connections:
u.time += con.duration()
us = sorted(dc.users, key = lambda u: -u.time)
for u in us:
globalTime += u.time
us = us[:maxUsers]
with openTempfile("usertim... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.