hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c02cbaf3a9dd0acce71a6b62439a6434f91e6d4 | 1,041 | py | Python | findRDSSnapshotsOlderThanXdays.py | alphacrack/aws-boto-scripts | 36780e9c5e09cbfe830a6830225222859dc55286 | [
"Apache-2.0"
] | 43 | 2015-04-28T21:55:27.000Z | 2022-02-18T09:34:03.000Z | findRDSSnapshotsOlderThanXdays.py | payalaharikrishna/aws-boto-scripts | 36780e9c5e09cbfe830a6830225222859dc55286 | [
"Apache-2.0"
] | null | null | null | findRDSSnapshotsOlderThanXdays.py | payalaharikrishna/aws-boto-scripts | 36780e9c5e09cbfe830a6830225222859dc55286 | [
"Apache-2.0"
] | 71 | 2015-04-26T00:30:07.000Z | 2022-01-15T07:27:54.000Z | import boto.rds
from datetime import date, timedelta,datetime
from dateutil.parser import parse
import csv
days_counter=45
region="ap-southeast-1"
conn = boto.rds.connect_to_region(region)
# amis=ec2conn.get_all_images(owners='self')
print conn.get_all_dbsnapshots()
print type(conn.get_all_dbsnapshots())
# class Am... | 24.209302 | 86 | 0.692603 | import boto.rds
from datetime import date, timedelta,datetime
from dateutil.parser import parse
import csv
days_counter=45
region="ap-southeast-1"
conn = boto.rds.connect_to_region(region)
print conn.get_all_dbsnapshots()
print type(conn.get_all_dbsnapshots())
# ec2conn = boto.ec2.connect_to_region(region)
# amis=e... | false | true |
1c02cbe203721e5bddd30f2f1b740e94d6b24c24 | 3,098 | py | Python | src/oci/fips.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/fips.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/fips.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 26.93913 | 245 | 0.654939 |
from __future__ import absolute_import
import sys
import ctypes
import logging
import os
class DevNull:
def write(self, msg):
pass
def override_libcrypto(fips_libcrypto_path):
_bs_crypto = ctypes.CDLL(fips_libcrypto_path)
_bs_crypto.FIPS_mode_set(ctypes.c_int(1))
import ssl if not has... | true | true |
1c02cc341eda998a41a468c758008bb1da86efcd | 10,970 | py | Python | aligner/features/processing.py | zhouyangnk/Montreal-Forced-Aligner | 4f8733409e79a50744616921a04fccf115e8af6f | [
"MIT"
] | 1 | 2021-03-09T03:15:14.000Z | 2021-03-09T03:15:14.000Z | aligner/features/processing.py | missaaoo/Montreal-Forced-Aligner | 62a40e2337448752a4b8fc7a4ec9cbf3f159fbff | [
"MIT"
] | null | null | null | aligner/features/processing.py | missaaoo/Montreal-Forced-Aligner | 62a40e2337448752a4b8fc7a4ec9cbf3f159fbff | [
"MIT"
] | 1 | 2021-03-09T03:15:17.000Z | 2021-03-09T03:15:17.000Z | import multiprocessing as mp
import subprocess
import shutil
import os
from ..helper import make_path_safe, thirdparty_binary, filter_scp
from ..exceptions import CorpusError
def mfcc_func(directory, job_name, mfcc_config_path): # pragma: no cover
log_directory = os.path.join(directory, 'log')
raw_mfcc_path... | 52.740385 | 142 | 0.51887 | import multiprocessing as mp
import subprocess
import shutil
import os
from ..helper import make_path_safe, thirdparty_binary, filter_scp
from ..exceptions import CorpusError
def mfcc_func(directory, job_name, mfcc_config_path): log_directory = os.path.join(directory, 'log')
raw_mfcc_path = os.path.join(dir... | true | true |
1c02ccb032d0f280e0dc7f696a36fc37291cc3f7 | 1,962 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/graphics/test_music_album_mp3.py | ythej/gaia | 309cb1a71beb5adc61ee1162bad42c4e9167f853 | [
"Apache-2.0"
] | 1 | 2019-02-13T23:44:14.000Z | 2019-02-13T23:44:14.000Z | tests/python/gaia-ui-tests/gaiatest/tests/graphics/test_music_album_mp3.py | ythej/gaia | 309cb1a71beb5adc61ee1162bad42c4e9167f853 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/graphics/test_music_album_mp3.py | ythej/gaia | 309cb1a71beb5adc61ee1162bad42c4e9167f853 | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from marionette.wait import Wait
from marionette.marionette import Actions
from marionette.by import By
fr... | 33.827586 | 85 | 0.683486 |
import time
from marionette.wait import Wait
from marionette.marionette import Actions
from marionette.by import By
from gaiatest.gaia_graphics_test import GaiaImageCompareTestCase
from gaiatest.apps.music.app import Music
class TestMusic(GaiaImageCompareTestCase):
_player_controls_previous_locator = (By.ID, '... | true | true |
1c02ccfc80cc80bdd1ad9baa89799eb866e75661 | 31,674 | py | Python | keystone/tests/unit/core.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/core.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/core.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 35.271715 | 79 | 0.612553 |
from __future__ import absolute_import
import atexit
import base64
import datetime
import functools
import hashlib
import json
import ldap
import os
import re
import shutil
import socket
import sys
import uuid
import warnings
import fixtures
from oslo_config import fixture as config_fixture
from oslo_context import c... | true | true |
1c02cd6f34f0c7a640e2a01d20d750eea7ad7282 | 6,307 | py | Python | conans/test/generators/pkg_config_test.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | conans/test/generators/pkg_config_test.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | conans/test/generators/pkg_config_test.py | datalogics-kam/conan | 7bf230cd5f8ef68eb804908777ebaad75e951b16 | [
"MIT"
] | null | null | null | import os
import platform
import unittest
from conans.client.generators.pkg_config import PkgConfigGenerator
from conans.model.settings import Settings
from conans.model.conan_file import ConanFile
from conans.model.build_info import CppInfo
from conans.model.ref import ConanFileReference
from conans.test.utils.tools ... | 33.194737 | 83 | 0.646742 | import os
import platform
import unittest
from conans.client.generators.pkg_config import PkgConfigGenerator
from conans.model.settings import Settings
from conans.model.conan_file import ConanFile
from conans.model.build_info import CppInfo
from conans.model.ref import ConanFileReference
from conans.test.utils.tools ... | true | true |
1c02cd82b7fa633684350b4e1df68af15754f26e | 29,767 | py | Python | Tests/test_PhyloXML.py | ToyokoLabs/biopython | e433ab297c1dce767a323a1eea65358bca3edc51 | [
"BSD-3-Clause"
] | 6 | 2015-04-22T17:18:46.000Z | 2020-06-02T14:16:20.000Z | Tests/test_PhyloXML.py | ToyokoLabs/biopython | e433ab297c1dce767a323a1eea65358bca3edc51 | [
"BSD-3-Clause"
] | 2 | 2017-04-24T11:24:10.000Z | 2022-01-13T14:59:14.000Z | Tests/test_PhyloXML.py | ToyokoLabs/biopython | e433ab297c1dce767a323a1eea65358bca3edc51 | [
"BSD-3-Clause"
] | 7 | 2015-11-03T11:09:05.000Z | 2022-01-29T22:09:53.000Z | # Copyright (C) 2009 by Eric Talevich (eric.talevich@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Unit tests for the PhyloXML and PhyloXMLIO modules."""
import os
import tempfile
imp... | 37.919745 | 88 | 0.567575 |
import os
import tempfile
import unittest
from itertools import chain
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Align import MultipleSeqAlignment
from Bio.Phylo import PhyloXML as PX, PhyloXMLIO
EX_APAF = "PhyloXML/apaf.xml"
EX_BCL2 = "PhyloXML/bcl_2.xml"
EX_MADE = "PhyloXML/made_up.xml"
... | true | true |
1c02ce1682b64d545a786850489571427d8976b3 | 37,730 | py | Python | tests/impls/nn_index/test_lsh.py | Purg/SMQTK-Indexing | 24b5f875ec01a93f1c4842381a6de88041166604 | [
"BSD-3-Clause"
] | null | null | null | tests/impls/nn_index/test_lsh.py | Purg/SMQTK-Indexing | 24b5f875ec01a93f1c4842381a6de88041166604 | [
"BSD-3-Clause"
] | null | null | null | tests/impls/nn_index/test_lsh.py | Purg/SMQTK-Indexing | 24b5f875ec01a93f1c4842381a6de88041166604 | [
"BSD-3-Clause"
] | null | null | null | import collections
import json
import random
import types
from typing import Any, Callable, Dict, Iterable, Optional, Tuple
import unittest.mock as mock
import unittest
import numpy as np
import pytest
from smqtk_core.configuration import configuration_test_helper
from smqtk_dataprovider.exceptions import ReadOnlyEr... | 38.5 | 111 | 0.609754 | import collections
import json
import random
import types
from typing import Any, Callable, Dict, Iterable, Optional, Tuple
import unittest.mock as mock
import unittest
import numpy as np
import pytest
from smqtk_core.configuration import configuration_test_helper
from smqtk_dataprovider.exceptions import ReadOnlyEr... | true | true |
1c02ce2856743d7b78a71d968ac48cb6dcc71ee0 | 3,582 | py | Python | unit-test/sample_problems.py | cjosey/PINSPEC | 8c4bed18097c1461b7271c1b68af6dc6f1c78806 | [
"MIT"
] | 1 | 2020-10-14T14:32:25.000Z | 2020-10-14T14:32:25.000Z | unit-test/sample_problems.py | cjosey/PINSPEC | 8c4bed18097c1461b7271c1b68af6dc6f1c78806 | [
"MIT"
] | null | null | null | unit-test/sample_problems.py | cjosey/PINSPEC | 8c4bed18097c1461b7271c1b68af6dc6f1c78806 | [
"MIT"
] | null | null | null | import numpy
from pinspec import *
import pinspec.SLBW as SLBW
import pinspec.plotter as plotter
import pinspec.process as process
from pinspec.log import *
import math
import unittest
# run 2012 22.211 hw2
class TestHW2(unittest.TestCase):
def setUp(self):
# Set main simulation params
s... | 34.114286 | 89 | 0.542993 | import numpy
from pinspec import *
import pinspec.SLBW as SLBW
import pinspec.plotter as plotter
import pinspec.process as process
from pinspec.log import *
import math
import unittest
class TestHW2(unittest.TestCase):
def setUp(self):
self.num_neutrons = 100000
setOutputDirector... | true | true |
1c02ce436f39a2cf647411be441bc592afbb20d8 | 1,156 | py | Python | setup.py | openfinch/pycognito | ce22ed53f64350cc597d3f1650b233989f307ae1 | [
"Apache-2.0"
] | 74 | 2020-03-16T11:46:16.000Z | 2022-03-28T10:42:59.000Z | setup.py | openfinch/pycognito | ce22ed53f64350cc597d3f1650b233989f307ae1 | [
"Apache-2.0"
] | 66 | 2020-03-25T13:25:56.000Z | 2022-03-31T11:06:05.000Z | setup.py | openfinch/pycognito | ce22ed53f64350cc597d3f1650b233989f307ae1 | [
"Apache-2.0"
] | 31 | 2020-04-01T13:55:45.000Z | 2022-03-29T20:15:32.000Z | from pathlib import Path
from setuptools import setup, find_packages
VERSION = "2021.03.1"
setup(
name="pycognito",
version=VERSION,
description="Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support.",
long_description=Path("README.md").read_text(),
long... | 32.111111 | 115 | 0.653114 | from pathlib import Path
from setuptools import setup, find_packages
VERSION = "2021.03.1"
setup(
name="pycognito",
version=VERSION,
description="Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support.",
long_description=Path("README.md").read_text(),
long... | true | true |
1c02ce538be1758941da45bb49a791ffe34e8a71 | 1,272 | py | Python | dictTranslate.py | Imontalvod1995/Persefone | cb267febd4896f51b4a80e9020c2ed714fb75819 | [
"MIT"
] | null | null | null | dictTranslate.py | Imontalvod1995/Persefone | cb267febd4896f51b4a80e9020c2ed714fb75819 | [
"MIT"
] | null | null | null | dictTranslate.py | Imontalvod1995/Persefone | cb267febd4896f51b4a80e9020c2ed714fb75819 | [
"MIT"
] | null | null | null | #####################################################
# dictTranslate.py #
# made by Iván Montalvo & Santiago Buitrago #
# #
# Translation of the classes to the characters. #
# ... | 22.714286 | 54 | 0.225629 |
def numberToLabel(number):
switcher = {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "ae",
11: "am",
12: "a",
13: "b",
14: "con",
... | true | true |
1c02cf1d5389151843b1392e818592f06517b2a3 | 1,259 | py | Python | API/course/urls.py | kasimbozdag/SWE_573 | 4bce24f98fe6980b1f2c83196b8454b56118186b | [
"MIT"
] | null | null | null | API/course/urls.py | kasimbozdag/SWE_573 | 4bce24f98fe6980b1f2c83196b8454b56118186b | [
"MIT"
] | 52 | 2019-02-19T10:43:11.000Z | 2022-02-10T10:36:37.000Z | API/course/urls.py | kasimbozdag/SWE_573 | 4bce24f98fe6980b1f2c83196b8454b56118186b | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^create_course', views.CourseCreateAPIView.as_view(), name="create-course"),
url(r'^list', views.CourseListAPIView.as_view(), name="courses"),
url(r'^my', views.TeacherCoursesAPIView.as_view(), name="my-courses"),
url(r'^(?P<pk... | 62.95 | 146 | 0.660048 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^create_course', views.CourseCreateAPIView.as_view(), name="create-course"),
url(r'^list', views.CourseListAPIView.as_view(), name="courses"),
url(r'^my', views.TeacherCoursesAPIView.as_view(), name="my-courses"),
url(r'^(?P<pk... | true | true |
1c02cfa02081b10c6f4cddf140b8d2d0447a4c03 | 4,633 | py | Python | cli/tasdae-cli.py | rostegg/tasdae | 9e628f509f9fc1db7568a9fb29e49f1a0433ebf0 | [
"MIT"
] | null | null | null | cli/tasdae-cli.py | rostegg/tasdae | 9e628f509f9fc1db7568a9fb29e49f1a0433ebf0 | [
"MIT"
] | null | null | null | cli/tasdae-cli.py | rostegg/tasdae | 9e628f509f9fc1db7568a9fb29e49f1a0433ebf0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from prompt_toolkit.application import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.bindings.focus import (
focus_next,
focus_previ... | 25.31694 | 79 | 0.586877 |
from prompt_toolkit.application import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.bindings.focus import (
focus_next,
focus_previous,
)
from prompt_tool... | true | true |
1c02d18b5317a8e74ea4a7c2ccf1c7aa9ad91004 | 742 | py | Python | src/myQueue.py | toni-tang/MusicBot | 0f6cc07621dcb4e9af4d92a27ee520241359299c | [
"MIT"
] | null | null | null | src/myQueue.py | toni-tang/MusicBot | 0f6cc07621dcb4e9af4d92a27ee520241359299c | [
"MIT"
] | null | null | null | src/myQueue.py | toni-tang/MusicBot | 0f6cc07621dcb4e9af4d92a27ee520241359299c | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Queue:
def __init__(self):
self.front = self.rear = None
self.size = 0
def push(self, item):
newNode = Node(item)
if self.front is None:
self.front = self.rear =... | 21.823529 | 48 | 0.498652 | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Queue:
def __init__(self):
self.front = self.rear = None
self.size = 0
def push(self, item):
newNode = Node(item)
if self.front is None:
self.front = self.rear =... | true | true |
1c02d219f5a6c0060f35770d378b2fb306a5f46d | 3,503 | py | Python | ceed/examples/analysis/merge_ceed_with_mcs_data.py | cplab/ceed | 7bae74361a67a6ff3c447b63adb4c7c57839b339 | [
"MIT"
] | 1 | 2020-08-05T15:31:06.000Z | 2020-08-05T15:31:06.000Z | ceed/examples/analysis/merge_ceed_with_mcs_data.py | cplab/ceed | 7bae74361a67a6ff3c447b63adb4c7c57839b339 | [
"MIT"
] | null | null | null | ceed/examples/analysis/merge_ceed_with_mcs_data.py | cplab/ceed | 7bae74361a67a6ff3c447b63adb4c7c57839b339 | [
"MIT"
] | null | null | null | """
Merging Ceed Data with MCS Data
================================
The following script shows how to merge the ceed h5 data file that contains all
the experimental data from the projector stimulation side, with the multi-array
electrode (MEA) data recorded by the MCS system.
The MCS data must be first exported from... | 41.702381 | 79 | 0.727091 | from ceed.analysis.merge_data import CeedMCSDataMerger
import os.path
ceed_file = '../data/experiment_data_ceed.h5'
mcs_file = '../data/experiment_data_mcs.h5'
if not os.path.exists(ceed_file) or not os.path.exists(mcs_file):
raise Exception(
'Data not found, please manually extract ceed/examples/data/expe... | true | true |
1c02d2a14dc39f10f1f7192b4d3635b328c8715f | 841 | py | Python | init.py | mdy98cs/www | f21d87a20fac847f562f62d549d1e82de1be4df7 | [
"MIT"
] | null | null | null | init.py | mdy98cs/www | f21d87a20fac847f562f62d549d1e82de1be4df7 | [
"MIT"
] | null | null | null | init.py | mdy98cs/www | f21d87a20fac847f562f62d549d1e82de1be4df7 | [
"MIT"
] | null | null | null | #Import Flask Library
from flask import Flask, render_template, request, session, url_for, redirect
import pymysql.cursors
from appdef import app, conn
import register
import login
import publicinfo
import customer
import agent
import staff
import purchase
# Understanding Flask static: http://stackoverflow.com/a/2820... | 24.735294 | 77 | 0.751486 | from flask import Flask, render_template, request, session, url_for, redirect
import pymysql.cursors
from appdef import app, conn
import register
import login
import publicinfo
import customer
import agent
import staff
import purchase
@app.route('/')
def hello():
return render_template('index.html')
@app.route('/... | true | true |
1c02d2b9725aa1a04423ff3dddefe88f5f4e4132 | 48,232 | py | Python | pymc/StepMethods.py | matthew-brett/pymc | 3a31613f056e7993a449d89bafef5fdaa40d47e9 | [
"MIT"
] | 5 | 2015-12-03T09:42:44.000Z | 2021-06-06T19:23:29.000Z | pymc/StepMethods.py | matthew-brett/pymc | 3a31613f056e7993a449d89bafef5fdaa40d47e9 | [
"MIT"
] | 1 | 2016-09-27T02:00:41.000Z | 2016-09-27T02:15:32.000Z | pymc/StepMethods.py | matthew-brett/pymc | 3a31613f056e7993a449d89bafef5fdaa40d47e9 | [
"MIT"
] | 1 | 2017-10-27T13:27:32.000Z | 2017-10-27T13:27:32.000Z | from __future__ import division
import numpy as np
from utils import msqrt, check_type, round_array, float_dtypes, integer_dtypes, bool_dtypes, safe_len, find_generations, logp_of_set, symmetrize
from numpy import ones, zeros, log, shape, cov, ndarray, inner, reshape, sqrt, any, array, all, abs, exp, where, isscalar, ... | 35.490802 | 283 | 0.612996 | from __future__ import division
import numpy as np
from utils import msqrt, check_type, round_array, float_dtypes, integer_dtypes, bool_dtypes, safe_len, find_generations, logp_of_set, symmetrize
from numpy import ones, zeros, log, shape, cov, ndarray, inner, reshape, sqrt, any, array, all, abs, exp, where, isscalar, ... | false | true |
1c02d2e50e0b3bd3da58c41a005d52759eb55d9c | 3,248 | py | Python | app/app/settings.py | hm289/recipe-app-api | bd3885f22602d433cbf5bb47d404e6f88db77e16 | [
"MIT"
] | null | null | null | app/app/settings.py | hm289/recipe-app-api | bd3885f22602d433cbf5bb47d404e6f88db77e16 | [
"MIT"
] | null | null | null | app/app/settings.py | hm289/recipe-app-api | bd3885f22602d433cbf5bb47d404e6f88db77e16 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.574803 | 91 | 0.688116 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'dobpfgn1j(#j24l(hsf2hnstw#v&^e!o64r%3pi@r*b9k8&@k@'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c02d3c9c7efaba7ec7e344c9cb02e9923079010 | 92 | py | Python | output/models/saxon_data/zone/zone003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/saxon_data/zone/zone003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/saxon_data/zone/zone003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.saxon_data.zone.zone003_xsd.zone003 import Doc
__all__ = [
"Doc",
]
| 15.333333 | 65 | 0.728261 | from output.models.saxon_data.zone.zone003_xsd.zone003 import Doc
__all__ = [
"Doc",
]
| true | true |
1c02d4b2a6d5aa8fc74782e09e195c8d674d3c6b | 5,856 | py | Python | dashboard/plugins/s3_usage/refresher.py | szczeles/discreETLy | 9df5f908bca2911208e777b1d288596966c16314 | [
"MIT"
] | 65 | 2018-12-14T13:40:46.000Z | 2021-11-27T12:51:29.000Z | dashboard/plugins/s3_usage/refresher.py | szczeles/discreETLy | 9df5f908bca2911208e777b1d288596966c16314 | [
"MIT"
] | 10 | 2018-12-18T14:35:48.000Z | 2020-01-27T16:50:30.000Z | dashboard/plugins/s3_usage/refresher.py | szczeles/discreETLy | 9df5f908bca2911208e777b1d288596966c16314 | [
"MIT"
] | 6 | 2019-01-18T21:49:45.000Z | 2020-08-02T07:29:17.000Z | import boto3
import sqlite3
import fcntl
import os
import time
import threading
import re
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from dashboard.utils import Timer
STATS_DB_PATH = '/var/run/discreetly/s3_stats.db'
STATS_DB_TMP_PATH = '/var... | 38.27451 | 162 | 0.612193 | import boto3
import sqlite3
import fcntl
import os
import time
import threading
import re
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from dashboard.utils import Timer
STATS_DB_PATH = '/var/run/discreetly/s3_stats.db'
STATS_DB_TMP_PATH = '/var... | true | true |
1c02d4ea83d77dbf9db274dfaf6f622627a98796 | 510 | py | Python | UTRfold_gquadruplex_wrapper.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | null | null | null | UTRfold_gquadruplex_wrapper.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | null | null | null | UTRfold_gquadruplex_wrapper.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | 1 | 2021-10-30T07:37:19.000Z | 2021-10-30T07:37:19.000Z | import subprocess
import os
for fasta in os.listdir('.'):
if os.path.basename(fasta).endswith('fa'):
print fasta
name = os.path.basename(fasta).split('.')[0] + '.' + os.path.basename(fasta).split('.')[1]
output = name + '.gquadout.txt'
windowsize = '80'
slidesize = '10'
print 'Folding {0}...'.format(name)... | 36.428571 | 161 | 0.660784 | import subprocess
import os
for fasta in os.listdir('.'):
if os.path.basename(fasta).endswith('fa'):
print fasta
name = os.path.basename(fasta).split('.')[0] + '.' + os.path.basename(fasta).split('.')[1]
output = name + '.gquadout.txt'
windowsize = '80'
slidesize = '10'
print 'Folding {0}...'.format(name)... | false | true |
1c02d5460a4d4784219ca82ba6e987205d16105f | 6,323 | py | Python | ssod/datasets/builder.py | huimlight/SoftTeacher | 97064fbcce1ab87b40977544ba7a9c488274d66f | [
"MIT"
] | 604 | 2021-08-09T03:00:35.000Z | 2022-03-31T13:43:14.000Z | ssod/datasets/builder.py | huimlight/SoftTeacher | 97064fbcce1ab87b40977544ba7a9c488274d66f | [
"MIT"
] | 158 | 2021-08-29T07:58:22.000Z | 2022-03-31T15:23:27.000Z | ssod/datasets/builder.py | huimlight/SoftTeacher | 97064fbcce1ab87b40977544ba7a9c488274d66f | [
"MIT"
] | 92 | 2021-08-24T07:29:37.000Z | 2022-03-29T03:01:34.000Z | from collections.abc import Mapping, Sequence
from functools import partial
import torch
from mmcv.parallel import DataContainer
from mmcv.runner import get_dist_info
from mmcv.utils import Registry, build_from_cfg
from mmdet.datasets.builder import worker_init_fn
from mmdet.datasets.samplers import (
DistributedG... | 35.723164 | 88 | 0.582951 | from collections.abc import Mapping, Sequence
from functools import partial
import torch
from mmcv.parallel import DataContainer
from mmcv.runner import get_dist_info
from mmcv.utils import Registry, build_from_cfg
from mmdet.datasets.builder import worker_init_fn
from mmdet.datasets.samplers import (
DistributedG... | true | true |
1c02d5506cf9a1693bb23f613027484d749ac115 | 1,271 | py | Python | app/auth/forms.py | BrendaMwiza/News | b68d53d0aefac78fae3de557c145cefd69e03c6b | [
"MIT"
] | 1 | 2020-04-26T23:43:00.000Z | 2020-04-26T23:43:00.000Z | app/auth/forms.py | antomuli/1_Minute_Pitch | 8689a74c2fdb45ade12f9480ddea354f1bd57e9b | [
"Unlicense"
] | null | null | null | app/auth/forms.py | antomuli/1_Minute_Pitch | 8689a74c2fdb45ade12f9480ddea354f1bd57e9b | [
"Unlicense"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField,BooleanField,SubmitField
from wtforms.validators import Required,Email,EqualTo
from ..models import User
from wtforms import ValidationError
class RegistrationForm(FlaskForm):
email = StringField('Your Email Address',validators=[Required... | 48.884615 | 128 | 0.734068 | from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField,BooleanField,SubmitField
from wtforms.validators import Required,Email,EqualTo
from ..models import User
from wtforms import ValidationError
class RegistrationForm(FlaskForm):
email = StringField('Your Email Address',validators=[Required... | true | true |
1c02d5623241dce0f939abc06aaa17ba4d044724 | 405 | py | Python | accounts/migrations/0002_customuser_phone_number.py | yaseen1998/djangoX | 0c5a8e0692baa3e03bdc43a8ddcc669055b32c06 | [
"MIT"
] | null | null | null | accounts/migrations/0002_customuser_phone_number.py | yaseen1998/djangoX | 0c5a8e0692baa3e03bdc43a8ddcc669055b32c06 | [
"MIT"
] | null | null | null | accounts/migrations/0002_customuser_phone_number.py | yaseen1998/djangoX | 0c5a8e0692baa3e03bdc43a8ddcc669055b32c06 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-12-08 21:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='phone_number',
... | 21.315789 | 73 | 0.604938 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='customuser',
name='phone_number',
field=models.CharField(blank=True, max_l... | true | true |
1c02d56fd7521f30e111f0eea5c7978a803c4106 | 649 | py | Python | setup.py | NFJones/cliffy | 4e632fa3bb07d92931b4cc3f7d01ca1ea356a9ce | [
"MIT"
] | null | null | null | setup.py | NFJones/cliffy | 4e632fa3bb07d92931b4cc3f7d01ca1ea356a9ce | [
"MIT"
] | null | null | null | setup.py | NFJones/cliffy | 4e632fa3bb07d92931b4cc3f7d01ca1ea356a9ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from distutils.core import setup
from setuptools import find_packages
requirements = []
with open('./requirements.txt', 'r') as infile:
for line in infile:
requirements.append(line.replace('\n', '').replace('\r', ''))
setup(name='cliffy',
version='0.0.1',
description='A... | 30.904762 | 78 | 0.674884 |
from distutils.core import setup
from setuptools import find_packages
requirements = []
with open('./requirements.txt', 'r') as infile:
for line in infile:
requirements.append(line.replace('\n', '').replace('\r', ''))
setup(name='cliffy',
version='0.0.1',
description='A convenient CLI wrapper... | true | true |
1c02d5b959e08be2705abf04618a116e427eec83 | 2,688 | py | Python | IPP_3.4_Anagram.py | AnchorageBot/PythonProjects | 8c8df97e6c526a82ea8c2fdd377884763229259c | [
"MIT"
] | null | null | null | IPP_3.4_Anagram.py | AnchorageBot/PythonProjects | 8c8df97e6c526a82ea8c2fdd377884763229259c | [
"MIT"
] | null | null | null | IPP_3.4_Anagram.py | AnchorageBot/PythonProjects | 8c8df97e6c526a82ea8c2fdd377884763229259c | [
"MIT"
] | null | null | null | # This script will ask a user to input a word, then look for anagrams, after loading a text file as a dictionary
# elvis and lives are examples of anagrams
# Source code/inspiration/software/text file
# Impractical Python Projects by Lee Vaughn, Chapter 3, Project 4+
# Made with Mu 1.0.3 in November 2021
... | 46.344828 | 142 | 0.596726 |
import sys import time
start_time = time.time() # start the script runtime clock
# Dictionary function
def loadDictionary(file):
... | true | true |
1c02d66764594ea8953729a7a643a277ea50e4c3 | 4,888 | py | Python | citest/json_contract/observation_failure.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 69 | 2016-04-05T15:15:49.000Z | 2021-10-21T01:29:36.000Z | citest/json_contract/observation_failure.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 95 | 2016-04-06T13:31:09.000Z | 2020-08-13T22:53:40.000Z | citest/json_contract/observation_failure.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 50 | 2016-04-05T14:10:57.000Z | 2021-10-21T01:29:26.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.805369 | 77 | 0.721358 |
import logging
import citest.json_predicate as jp
from . import observation_predicate as op
from . import observation_verifier as ov
from . import observer
class ObservationFailedError(jp.PredicateResult):
@property
def failures(self):
return self.__failures
def __init__(self, failures, valid=False):
... | true | true |
1c02d6eff5cf64207bea75fccf99cbe6d3e4da6a | 448 | py | Python | comps/migrations/0029_auto_20200530_0030.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | null | null | null | comps/migrations/0029_auto_20200530_0030.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | 87 | 2020-04-15T22:29:03.000Z | 2022-01-02T02:21:28.000Z | comps/migrations/0029_auto_20200530_0030.py | dlanghorne0428/dancesport-tracker-projec | e55d91a4f03c26d6ee8c28846a809064adfdb158 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-05-30 00:30
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comps', '0028_auto_20200525_1634'),
]
operations = [
migrations.AlterField(
model_name='comp',
name... | 22.4 | 101 | 0.631696 |
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comps', '0028_auto_20200525_1634'),
]
operations = [
migrations.AlterField(
model_name='comp',
name='logo',
field=cloudinary.models.Clo... | true | true |
1c02d70ed5317ebcb334b851ffb7e6b9607c4ca3 | 7,953 | py | Python | tests/test_simulation_config.py | clprenz/de_sim | 3944a1c46c4387a78e1c412d760b7f6ade27a1c0 | [
"MIT"
] | null | null | null | tests/test_simulation_config.py | clprenz/de_sim | 3944a1c46c4387a78e1c412d760b7f6ade27a1c0 | [
"MIT"
] | null | null | null | tests/test_simulation_config.py | clprenz/de_sim | 3944a1c46c4387a78e1c412d760b7f6ade27a1c0 | [
"MIT"
] | null | null | null | """ Simulation configuration
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2020-03-16
:Copyright: 2020, Karr Lab
:License: MIT
"""
import copy
import os
import pickle
import unittest
import shutil
import tempfile
from de_sim.errors import SimulatorError
from de_sim.simulation_config import SimulationCon... | 40.370558 | 119 | 0.687162 |
import copy
import os
import pickle
import unittest
import shutil
import tempfile
from de_sim.errors import SimulatorError
from de_sim.simulation_config import SimulationConfig
class TestSimulationConfig(unittest.TestCase):
def setUp(self):
self.tmp_dir = tempfile.mkdtemp()
self.time_max = 10.0... | true | true |
1c02d7c32de62a75f8a0b54a86ee11eca72416c2 | 13,780 | py | Python | main_window.py | joelnir/SplitNotes | 199acd484727ec2ccc982d387d1f9a53ab1f6a39 | [
"MIT"
] | 12 | 2016-01-14T01:06:47.000Z | 2018-10-24T15:32:32.000Z | main_window.py | joelnir/SplitNotes | 199acd484727ec2ccc982d387d1f9a53ab1f6a39 | [
"MIT"
] | 16 | 2016-01-02T23:54:50.000Z | 2018-10-15T16:11:27.000Z | main_window.py | joeloskarsson/SplitNotes | 199acd484727ec2ccc982d387d1f9a53ab1f6a39 | [
"MIT"
] | 2 | 2021-05-04T09:18:02.000Z | 2022-01-07T22:22:15.000Z | import tkinter
from tkinter import messagebox
import os
import sys
import config
import ls_connection as con
import note_reader as noter
import setting_handler
runtime_info = {
"ls_connected": False,
"timer_running": False,
"active_split": -1,
"notes": [],
"server_port": 0,
"force_reset": False,
"double_layou... | 26.705426 | 82 | 0.719956 | import tkinter
from tkinter import messagebox
import os
import sys
import config
import ls_connection as con
import note_reader as noter
import setting_handler
runtime_info = {
"ls_connected": False,
"timer_running": False,
"active_split": -1,
"notes": [],
"server_port": 0,
"force_reset": False,
"double_layou... | true | true |
1c02d89ae37a0f17c78bd624996b81aea759aa1b | 13,768 | py | Python | sfft/EasyCrowdedPacket.py | DecretumWang/sfft | a0f64a76ff57bae78637df62feb1c6ce7578950f | [
"MIT"
] | 1 | 2021-12-21T13:09:01.000Z | 2021-12-21T13:09:01.000Z | sfft/EasyCrowdedPacket.py | DecretumWang/sfft | a0f64a76ff57bae78637df62feb1c6ce7578950f | [
"MIT"
] | null | null | null | sfft/EasyCrowdedPacket.py | DecretumWang/sfft | a0f64a76ff57bae78637df62feb1c6ce7578950f | [
"MIT"
] | null | null | null | import os
import time
import numpy as np
import os.path as pa
from astropy.io import fits
from tempfile import mkdtemp
from astropy.time import Time
from sfft.utils.meta.FileLockKit import FileLock
from sfft.AutoCrowdedPrep import Auto_CrowdedPrep
__author__ = "Lei Hu <hulei@pmo.ac.cn>"
__version__ = "v1.0"
class Eas... | 53.992157 | 128 | 0.557452 | import os
import time
import numpy as np
import os.path as pa
from astropy.io import fits
from tempfile import mkdtemp
from astropy.time import Time
from sfft.utils.meta.FileLockKit import FileLock
from sfft.AutoCrowdedPrep import Auto_CrowdedPrep
__author__ = "Lei Hu <hulei@pmo.ac.cn>"
__version__ = "v1.0"
class Eas... | true | true |
1c02d8f1568bb298d8267eb7207e2c580bdc9fd1 | 1,287 | py | Python | bindings/python/cntk/logging/__init__.py | vschs007/CNTK | 894d9e1a5d65d30cd33803c06a988844bb87fcb7 | [
"RSA-MD"
] | 5 | 2017-08-28T08:27:18.000Z | 2021-04-20T21:12:52.000Z | bindings/python/cntk/logging/__init__.py | vschs007/CNTK | 894d9e1a5d65d30cd33803c06a988844bb87fcb7 | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/logging/__init__.py | vschs007/CNTK | 894d9e1a5d65d30cd33803c06a988844bb87fcb7 | [
"RSA-MD"
] | 3 | 2019-08-23T11:42:14.000Z | 2022-01-06T08:41:32.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from cntk import cntk_py
from .progress_print import *
from .graph import *
from en... | 26.265306 | 80 | 0.637918 |
from cntk import cntk_py
from .progress_print import *
from .graph import *
from enum import Enum, unique
@unique
class TraceLevel(Enum):
Error = cntk_py.TraceLevel_Error
Warning = cntk_py.TraceLevel_Warning
Info = cntk_py.TraceLevel_Info
def __eq__(self, other):
if isinstance(other, TraceL... | true | true |
1c02d995aa907bbacae5c81489e972baed0605bc | 1,601 | py | Python | var/spack/repos/builtin/packages/r-gamlss/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-gamlss/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-gamlss/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RGamlss(RPackage):
"""Generalised Additive Models for Location Scale and Shape
Functi... | 47.088235 | 95 | 0.731418 |
from spack import *
class RGamlss(RPackage):
homepage = "https://cloud.r-project.org/package=gamlss"
url = "https://cloud.r-project.org/src/contrib/gamlss_5.1-2.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/gamlss/"
version('5.2-0', sha256='d3927547109064cbe7b0f955144f532... | true | true |
1c02da2dcd10437ae24e2e153c7b92dab585848a | 25 | py | Python | pyhomeseer/devices/__init__.py | lenaxia/PyHomeSeer-old | 25554836c6fcbc14425cd524656f14f258668eee | [
"MIT"
] | 9 | 2017-11-05T15:30:06.000Z | 2020-11-03T15:22:57.000Z | pyhomeseer/devices/__init__.py | lenaxia/PyHomeSeer-old | 25554836c6fcbc14425cd524656f14f258668eee | [
"MIT"
] | 2 | 2017-09-11T23:30:23.000Z | 2017-09-12T14:07:02.000Z | pyhomeseer/devices/__init__.py | lenaxia/PyHomeSeer-old | 25554836c6fcbc14425cd524656f14f258668eee | [
"MIT"
] | 3 | 2020-08-01T14:21:52.000Z | 2021-11-05T00:22:15.000Z | """ HomeSeer Devices """
| 12.5 | 24 | 0.6 | true | true | |
1c02da77d8c3dd9785bd637f07f3daa4f64dd881 | 3,883 | py | Python | samples/manindex.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | 15 | 2015-05-21T09:28:01.000Z | 2022-03-18T23:41:49.000Z | samples/manindex.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | null | null | null | samples/manindex.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | 13 | 2015-04-18T23:05:11.000Z | 2021-11-29T21:23:26.000Z | # ====================================================================
# 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 re... | 38.445545 | 148 | 0.56992 |
import os, re, sys
from subprocess import *
from lucene import IndexWriter, StandardAnalyzer, Document, Field
from lucene import SimpleFSDirectory, File, initVM, Version
def indexDirectory(dir):
for name in os.listdir(dir):
path = os.path.join(dir, name)
if os.path.isfile(path):
index... | false | true |
1c02da93140a8a809cd1f84227c854cac190efa4 | 248 | py | Python | ch10/regex/manage.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 30 | 2016-10-28T18:14:15.000Z | 2021-08-29T15:20:56.000Z | ch10/regex/manage.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | null | null | null | ch10/regex/manage.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 31 | 2016-09-10T22:47:12.000Z | 2022-03-13T04:50:35.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regex.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.545455 | 69 | 0.770161 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regex.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c02db28ae039f096aba65d6b7cc62ab5b721ed2 | 4,749 | py | Python | src/connect4/_version32/dqn.py | MrMonk3y/RL_from_scratch | 8d9ed9898a13ea945b7b5be1e9c0d32c32e63577 | [
"MIT"
] | 1 | 2019-02-10T16:44:23.000Z | 2019-02-10T16:44:23.000Z | src/connect4/_version32/dqn.py | MrMonk3y/RL_from_scratch | 8d9ed9898a13ea945b7b5be1e9c0d32c32e63577 | [
"MIT"
] | null | null | null | src/connect4/_version32/dqn.py | MrMonk3y/RL_from_scratch | 8d9ed9898a13ea945b7b5be1e9c0d32c32e63577 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 2 19:55:38 2018
@author: saschajecklin
"""
import sys
import os
sys.path.append("..")
import random
import numpy as np
from collections import deque
from keras.models import Model
from keras.layers import Dense, Flatten, Input, Conv2D
from keras.o... | 37.393701 | 125 | 0.639503 |
import sys
import os
sys.path.append("..")
import random
import numpy as np
from collections import deque
from keras.models import Model
from keras.layers import Dense, Flatten, Input, Conv2D
from keras.optimizers import RMSprop
from keras.regularizers import l2
from keras.layers.merge import Add
from keras.layers.nor... | true | true |
1c02db3c86424143534f4e06eeb8b1ef72c36832 | 578 | py | Python | app/core/management/commands/wait_for_db.py | prahladtripathi19/django-drf-docker | 052a0f310de47648bddefbec6f75e0b9481791f3 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | prahladtripathi19/django-drf-docker | 052a0f310de47648bddefbec6f75e0b9481791f3 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | prahladtripathi19/django-drf-docker | 052a0f310de47648bddefbec6f75e0b9481791f3 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
""" Django command to pause execution untill data is available """
def handle(self, *args, **options):
self.stdout.write("waiting for databse...... | 27.52381 | 67 | 0.745675 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write("waiting for databse...")
db_conn = None
while not db_conn:
try:
db_conn = conne... | true | true |
1c02db4ca2896fa2fe9b0301d809e48497410c2f | 59 | py | Python | src/ssp/spark/streaming/lda/__init__.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 10 | 2020-03-12T11:51:46.000Z | 2022-03-24T04:56:05.000Z | src/ssp/spark/streaming/lda/__init__.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 12 | 2020-04-23T07:28:14.000Z | 2022-03-12T00:20:24.000Z | src/ssp/spark/streaming/lda/__init__.py | gyan42/spark-streaming-playground | 147ef9cbc31b7aed242663dee36143ebf0e8043f | [
"Apache-2.0"
] | 1 | 2020-04-20T14:48:38.000Z | 2020-04-20T14:48:38.000Z | from ssp.spark.streaming.lda.model import LdaModelOperation | 59 | 59 | 0.881356 | from ssp.spark.streaming.lda.model import LdaModelOperation | true | true |
1c02db5489551f303ae19158d83d353b61a82d5f | 2,559 | py | Python | dateparser/data/date_translation_data/shi-Latn.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/shi-Latn.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/shi-Latn.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | info = {
"name": "shi-Latn",
"date_order": "DMY",
"january": [
"inn",
"innayr"
],
"february": [
"bṛa",
"bṛayṛ"
],
"march": [
"maṛ",
"maṛṣ"
],
"april": [
"ibr",
"ibrir"
],
"may": [
"may",
"mayyu"
... | 15.052941 | 26 | 0.263384 | info = {
"name": "shi-Latn",
"date_order": "DMY",
"january": [
"inn",
"innayr"
],
"february": [
"bṛa",
"bṛayṛ"
],
"march": [
"maṛ",
"maṛṣ"
],
"april": [
"ibr",
"ibrir"
],
"may": [
"may",
"mayyu"
... | true | true |
1c02dbca91d97ce057661ea8f93b294ff411360f | 5,647 | py | Python | models/definitions/transformer_net.py | mirlomusica/neural_training | 6864e8bfa39190e92284bff697a419a16d5e6450 | [
"MIT"
] | 50 | 2020-05-30T19:55:28.000Z | 2020-11-12T10:55:26.000Z | models/definitions/transformer_net.py | mirlomusica/neural_training | 6864e8bfa39190e92284bff697a419a16d5e6450 | [
"MIT"
] | 4 | 2021-04-18T19:49:45.000Z | 2021-10-05T16:39:11.000Z | models/definitions/transformer_net.py | mirlomusica/neural_training | 6864e8bfa39190e92284bff697a419a16d5e6450 | [
"MIT"
] | 8 | 2020-05-31T00:22:47.000Z | 2020-11-09T06:08:26.000Z | """
Modifications to the original J.Johnson's architecture:
1. Instance normalization is used instead of batch normalization *
2. Instead of learned up-sampling use nearest-neighbor up-sampling followed by convolution **
3. No scaled tanh at the output of the network ***
* Ulyanov showe... | 45.540323 | 133 | 0.68532 |
import torch
class TransformerNet(torch.nn.Module):
def __init__(self):
super().__init__()
self.relu = torch.nn.ReLU()
num_of_channels = [3, 32, 64, 128]
kernel_sizes = [9, 3, 3]
stride_sizes = [1, 2, 2]
self.conv1 = ConvLayer(num_of_channels[0], n... | true | true |
1c02dbdc1bc6a58d7a79d03b82923d063d18cc88 | 1,835 | py | Python | data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/features/FFTFeatures.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/features/FFTFeatures.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/109477/gatsby-hackathon-seizure-master/code/python/seizures/features/FFTFeatures.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | from scipy.fftpack import fft, fftshift
import numpy as np
import math
from seizures.features.FeatureExtractBase import FeatureExtractBase
def nextpow2(i):
#n = 1
#while n < i: n *= 2
#return n
return int(2**math.ceil(math.log(i)/math.log(2)))
class FFTFeatures(FeatureExtractBase):
... | 35.288462 | 130 | 0.624523 | from scipy.fftpack import fft, fftshift
import numpy as np
import math
from seizures.features.FeatureExtractBase import FeatureExtractBase
def nextpow2(i):
return int(2**math.ceil(math.log(i)/math.log(2)))
class FFTFeatures(FeatureExtractBase):
def __init__(self, band_means, band_wi... | true | true |
1c02dbf851e7093b789c1003166784d19dba785c | 3,683 | py | Python | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/model/protected_instance_attachment.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/model/protected_instance_attachment.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-sdrs/huaweicloudsdksdrs/v1/model/protected_instance_attachment.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ProtectedInstanceAttachment:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict)... | 26.307143 | 80 | 0.563942 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ProtectedInstanceAttachment:
sensitive_list = []
openapi_types = {
'replication': 'str',
'device': 'str'
}
attribute_map = {
'replication': 'replication',
'dev... | true | true |
1c02dcaea6c66bbe186b8106ddb564fa9da25979 | 3,687 | py | Python | mnist/networks.py | tiago939/feature_aligment | 423c606b0bed5a677b5fddde9cd1f17af91bdab6 | [
"MIT"
] | 3 | 2021-06-24T16:50:45.000Z | 2021-06-24T19:44:20.000Z | mnist/networks.py | tiago939/feature_aligment | 423c606b0bed5a677b5fddde9cd1f17af91bdab6 | [
"MIT"
] | null | null | null | mnist/networks.py | tiago939/feature_aligment | 423c606b0bed5a677b5fddde9cd1f17af91bdab6 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
class Flatten(torch.nn.Module):
def forward(self, x):
batch_size = x.shape[0]
return x.view(batch_size, -1)
class unFlatten2(torch.nn.Module):
def forward(self, x):
batch_size = x.shape[0]
return x.view(batch_size, 1, 28, 2... | 26.335714 | 68 | 0.511798 | import torch
import torch.nn as nn
import numpy as np
class Flatten(torch.nn.Module):
def forward(self, x):
batch_size = x.shape[0]
return x.view(batch_size, -1)
class unFlatten2(torch.nn.Module):
def forward(self, x):
batch_size = x.shape[0]
return x.view(batch_size, 1, 28, 2... | true | true |
1c02ddfad25d99b29523d85002a0a7f7f94de1cd | 12,648 | py | Python | bin/sub_dock.py | gicsaw/VHTS | dd23cbb0216dd628bb95bf4bb7e93ce49514c89d | [
"MIT"
] | 1 | 2022-01-19T18:37:00.000Z | 2022-01-19T18:37:00.000Z | bin/sub_dock.py | AIDrug/VHTS | dd23cbb0216dd628bb95bf4bb7e93ce49514c89d | [
"MIT"
] | null | null | null | bin/sub_dock.py | AIDrug/VHTS | dd23cbb0216dd628bb95bf4bb7e93ce49514c89d | [
"MIT"
] | 1 | 2022-01-19T18:36:42.000Z | 2022-01-19T18:36:42.000Z | #!/usr/bin/env python
import sys
import os
import argparse
import vhts.pydock as pydock
from filelock import FileLock
import pandas as pd
def get_job_from_list(list_dir):
list_file = list_dir + '/list.txt'
if not os.path.exists(list_file):
job_idx = None
return job_idx
freeze_lock = FileLo... | 35.036011 | 79 | 0.630772 | import sys
import os
import argparse
import vhts.pydock as pydock
from filelock import FileLock
import pandas as pd
def get_job_from_list(list_dir):
list_file = list_dir + '/list.txt'
if not os.path.exists(list_file):
job_idx = None
return job_idx
freeze_lock = FileLock('{}.lock'.format(li... | true | true |
1c02de46df2259c28785d1632c8ebed860c1b471 | 1,078 | py | Python | kubernetes/test/test_policy_v1beta1_allowed_flex_volume.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2021-06-10T23:44:11.000Z | 2021-06-10T23:44:11.000Z | kubernetes/test/test_policy_v1beta1_allowed_flex_volume.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_policy_v1beta1_allowed_flex_volume.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2018-11-06T16:33:43.000Z | 2018-11-06T16:33:43.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 23.955556 | 109 | 0.74026 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.policy_v1beta1_allowed_flex_volume import PolicyV1beta1AllowedFlexVolume
class TestPolicyV1beta1AllowedFlexVolume(unittest.TestCase):
... | true | true |
1c02de7bae8fedcd7812e59df55eb0d78ee1a1e8 | 8,299 | py | Python | src/run.py | liyheng/FOP | e100a972753a5232d2eab399b1c4f76dfa43947e | [
"Apache-2.0"
] | 5 | 2021-07-28T08:31:33.000Z | 2021-12-22T06:49:37.000Z | src/run.py | liyheng/FOP | e100a972753a5232d2eab399b1c4f76dfa43947e | [
"Apache-2.0"
] | null | null | null | src/run.py | liyheng/FOP | e100a972753a5232d2eab399b1c4f76dfa43947e | [
"Apache-2.0"
] | 4 | 2021-07-09T04:56:57.000Z | 2022-01-08T04:53:27.000Z | import datetime
import os
import pprint
import time
import threading
import torch as th
from types import SimpleNamespace as SN
from utils.logging import Logger
from utils.timehelper import time_left, time_str
from os.path import dirname, abspath
from learners import REGISTRY as le_REGISTRY
from runners im... | 36.082609 | 117 | 0.626461 | import datetime
import os
import pprint
import time
import threading
import torch as th
from types import SimpleNamespace as SN
from utils.logging import Logger
from utils.timehelper import time_left, time_str
from os.path import dirname, abspath
from learners import REGISTRY as le_REGISTRY
from runners im... | true | true |
1c02df7a6c6569530a8688a3be83578179ef5e90 | 5,522 | py | Python | examples/gym/train_iqn_gym.py | cnheider/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 923 | 2017-06-01T08:27:42.000Z | 2022-03-24T02:17:04.000Z | examples/gym/train_iqn_gym.py | hardmaru/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 374 | 2017-06-02T02:07:50.000Z | 2021-06-29T22:05:38.000Z | examples/gym/train_iqn_gym.py | hardmaru/chainerrl | 018a29132d77e5af0f92161250c72aba10c6ce29 | [
"MIT"
] | 253 | 2017-06-04T10:31:50.000Z | 2022-03-19T15:20:51.000Z | """An example of training Categorical DQN against OpenAI Gym Envs.
This script is an example of training an IQN agent against OpenAI
Gym envs. Only discrete spaces are supported.
To solve CartPole-v0, run:
python train_categorical_dqn_gym.py --env CartPole-v0
"""
import argparse
import sys
import chainer.functi... | 36.569536 | 75 | 0.658457 |
import argparse
import sys
import chainer.functions as F
import chainer.links as L
from chainer import optimizers
import gym
import chainerrl
from chainerrl import experiments
from chainerrl import explorers
from chainerrl import misc
from chainerrl import replay_buffer
def main():
import logging
logging.b... | true | true |
1c02e0b18795b82b22ef13f69770a1bd62af50a6 | 1,344 | py | Python | source/handlers/inputHandler.py | alexander-l-stone/RogueAcademy | 726ac13448436f74729b6cc98d16e208c77e7674 | [
"MIT"
] | null | null | null | source/handlers/inputHandler.py | alexander-l-stone/RogueAcademy | 726ac13448436f74729b6cc98d16e208c77e7674 | [
"MIT"
] | null | null | null | source/handlers/inputHandler.py | alexander-l-stone/RogueAcademy | 726ac13448436f74729b6cc98d16e208c77e7674 | [
"MIT"
] | null | null | null | import tcod.event
from typing import Dict
#TODO: Figure out a good way of doing input handling.
class InputHandler:
def __init__(self):
pass
def handle_keypress(self, event) -> Dict[str,str]:
if(event.sym == tcod.event.K_UP or event.sym == tcod.event.K_w or event.sym == tcod.event.K_KP_8)... | 46.344828 | 111 | 0.553571 | import tcod.event
from typing import Dict
class InputHandler:
def __init__(self):
pass
def handle_keypress(self, event) -> Dict[str,str]:
if(event.sym == tcod.event.K_UP or event.sym == tcod.event.K_w or event.sym == tcod.event.K_KP_8):
return {"type": "move", "value": (0, 0, ... | true | true |
1c02e0dba64de08178caa8257c016f5530cce237 | 910 | py | Python | sifrekirici.py | hizirplay/hizircracker | 555dcdb6ca4dd2dfd8c8f7ed50582b823c802321 | [
"Unlicense"
] | null | null | null | sifrekirici.py | hizirplay/hizircracker | 555dcdb6ca4dd2dfd8c8f7ed50582b823c802321 | [
"Unlicense"
] | null | null | null | sifrekirici.py | hizirplay/hizircracker | 555dcdb6ca4dd2dfd8c8f7ed50582b823c802321 | [
"Unlicense"
] | null | null | null | import itertools
import string
def sifre_tahmini(sifre):
sifre = input("Sifre girin:")
semboller = ("'", '@', '%', '-', '*', ',', '&', '`', '.', '_', '!', '#', '$')
karakter = (string.ascii_lowercase + string.ascii_uppercase + string.digits)
denemeler = 0
for sifre_uzunluğu in range(1, 9): ... | 53.529412 | 210 | 0.621978 | import itertools
import string
def sifre_tahmini(sifre):
sifre = input("Sifre girin:")
semboller = ("'", '@', '%', '-', '*', ',', '&', '`', '.', '_', '!', ' karakter = (string.ascii_lowercase + string.ascii_uppercase + string.digits)
denemeler = 0
for sifre_uzunluğu in range(1, 9): #range içi... | true | true |
1c02e1d10e46d2e2abf8cee90fdd5df9fae61b70 | 2,883 | py | Python | btap/pipeline/create-pipeline.py | ogunnoo/aaw-contrib-containers | 8760c1427ba2ea497cc7f01e07fe80cfcb9bdb1e | [
"MIT"
] | 1 | 2022-01-15T16:59:27.000Z | 2022-01-15T16:59:27.000Z | btap/pipeline/create-pipeline.py | ogunnoo/aaw-contrib-containers | 8760c1427ba2ea497cc7f01e07fe80cfcb9bdb1e | [
"MIT"
] | 13 | 2021-11-10T19:42:04.000Z | 2022-03-14T12:58:21.000Z | btap/pipeline/create-pipeline.py | ogunnoo/aaw-contrib-containers | 8760c1427ba2ea497cc7f01e07fe80cfcb9bdb1e | [
"MIT"
] | 5 | 2021-12-14T13:57:35.000Z | 2022-03-24T17:54:14.000Z | import kfp
from kfp import dsl
from kfp.components import func_to_container_op
from kfp.components import load_component_from_file
@dsl.pipeline(name='Btap Pipeline',
description='MLP employed for Total energy consumed regression problem',
)
#define your pipeline
# def btap_pipeline(minio... | 46.5 | 134 | 0.585154 | import kfp
from kfp import dsl
from kfp.components import func_to_container_op
from kfp.components import load_component_from_file
@dsl.pipeline(name='Btap Pipeline',
description='MLP employed for Total energy consumed regression problem',
)
def btap_pipeline(minio_tenant:str = "standard"... | true | true |
1c02e25c4d2ad62836f0e502d22edccb170eeb19 | 18,005 | py | Python | LR_GRU.py | JiayinL/Dropout-Prediction | fd1de819579b641ff8c7aa416c1fb5cb6c6a7114 | [
"MIT"
] | null | null | null | LR_GRU.py | JiayinL/Dropout-Prediction | fd1de819579b641ff8c7aa416c1fb5cb6c6a7114 | [
"MIT"
] | null | null | null | LR_GRU.py | JiayinL/Dropout-Prediction | fd1de819579b641ff8c7aa416c1fb5cb6c6a7114 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import pandas_profiling
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm
from joblib import Parallel,delayed
import numpy as np
import json
import re
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim... | 35.373281 | 199 | 0.63599 |
import pandas as pd
import pandas_profiling
from sklearn.preprocessing import LabelEncoder
from tqdm import tqdm
from joblib import Parallel,delayed
import numpy as np
import json
import re
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from... | true | true |
1c02e33b38b6f785163882166de6976c107f3a65 | 21,278 | py | Python | appengine/monorail/tracker/issueadmin.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/tracker/issueadmin.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/monorail/tracker/issueadmin.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Servlets for issue tracker configuration.
These classes implement the Statuses, Labels and ... | 36.31058 | 79 | 0.718724 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import collections
import itertools
import logging
import time
from third_party import ezt
from features import filterrules_helpers
from features import filterrules_views
from features import savedqueries_he... | true | true |
1c02e378f77ff22d7096fdf11772a6ae47d26063 | 18,140 | py | Python | neutron/agent/l3/dvr_edge_router.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 1,080 | 2015-01-04T08:35:00.000Z | 2022-03-27T09:15:52.000Z | neutron/agent/l3/dvr_edge_router.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 24 | 2015-02-21T01:48:28.000Z | 2021-11-26T02:38:56.000Z | neutron/agent/l3/dvr_edge_router.py | congnt95/neutron | 6a73a362c5ff5b7c28c15a49f47a9900c0d2b4e1 | [
"Apache-2.0"
] | 1,241 | 2015-01-02T10:47:10.000Z | 2022-03-27T09:42:23.000Z | # Copyright (c) 2015 OpenStack Foundation
#
# 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 ... | 44.243902 | 79 | 0.642337 |
from neutron_lib import constants as lib_constants
from oslo_log import log as logging
from neutron.agent.l3 import dvr_local_router
from neutron.agent.l3 import dvr_snat_ns
from neutron.agent.l3 import router_info as router
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from ... | true | true |
1c02e3ae5bf5bfb8ee4fd801eaf7fb12b79d599b | 340 | py | Python | mod.py | dydx-git/Calcy | fba4510220599a1a148dad15da0cbb508905034c | [
"MIT"
] | null | null | null | mod.py | dydx-git/Calcy | fba4510220599a1a148dad15da0cbb508905034c | [
"MIT"
] | null | null | null | mod.py | dydx-git/Calcy | fba4510220599a1a148dad15da0cbb508905034c | [
"MIT"
] | null | null | null | def Mod(param1, param2):
if param1 == None:
param1=0
param1+=1
param1=float(param2)%param1
param1+=float(param2)
print('mod answer is: ', param1)
else:
if param1>0:
param1%=float(param2)
print('2nd mod answer is: ', param1)
... | 24.285714 | 49 | 0.508824 | def Mod(param1, param2):
if param1 == None:
param1=0
param1+=1
param1=float(param2)%param1
param1+=float(param2)
print('mod answer is: ', param1)
else:
if param1>0:
param1%=float(param2)
print('2nd mod answer is: ', param1)
... | true | true |
1c02e3cfae3939897d6b2413e8b89f628794b09a | 1,328 | py | Python | mesh_tensorflow/__init__.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | mesh_tensorflow/__init__.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | mesh_tensorflow/__init__.py | mzj14/mesh | bf04d24e7a9c54733dea014b82e5985a039da67c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.947368 | 98 | 0.807229 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from mesh_tensorflow import beam_search
from mesh_tensorflow import layers
from mesh_tensorflow import optimize
from mesh_tensorflow import placement_mesh_impl
from mesh_tensorflow import simd_mesh_impl
from ... | true | true |
1c02e492c2ac0e7796581b0a448855e1149d8c93 | 572 | py | Python | tests/test_phonosearch.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 97 | 2015-07-06T18:58:43.000Z | 2022-03-10T23:00:07.000Z | tests/test_phonosearch.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 443 | 2015-03-10T21:24:39.000Z | 2022-03-22T22:20:13.000Z | tests/test_phonosearch.py | akki2825/CorpusTools | ba236f55266eceb7e719fa36545985d8453953d3 | [
"BSD-3-Clause"
] | 22 | 2015-07-19T18:56:24.000Z | 2020-09-17T17:58:12.000Z |
import sys
import os
from corpustools.phonosearch import phonological_search
from corpustools.corpus.classes import EnvironmentFilter, Environment
def test_non_minimal_pair_corpus_minpair(unspecified_test_corpus):
envs = [EnvironmentFilter(['n'],['#'])]
results = phonological_search(unspecified_test_corpus, ... | 31.777778 | 81 | 0.741259 |
import sys
import os
from corpustools.phonosearch import phonological_search
from corpustools.corpus.classes import EnvironmentFilter, Environment
def test_non_minimal_pair_corpus_minpair(unspecified_test_corpus):
envs = [EnvironmentFilter(['n'],['#'])]
results = phonological_search(unspecified_test_corpus, ... | true | true |
1c02e6a2e19aac6c04f2df7ae754aec5e3e007fb | 3,480 | py | Python | ml/EngineFailurePrediction/score.py | SamVanhoutte/azure-time-travel | a87a6c96025bea4123859d5f739bbd90ea5fcd30 | [
"MIT"
] | 3 | 2020-07-29T08:08:52.000Z | 2021-03-17T07:40:51.000Z | ml/EngineFailurePrediction/score.py | SamVanhoutte/azure-time-travel | a87a6c96025bea4123859d5f739bbd90ea5fcd30 | [
"MIT"
] | 3 | 2021-12-02T13:29:36.000Z | 2022-02-06T09:50:34.000Z | ml/EngineFailurePrediction/score.py | SamVanhoutte/azure-time-travel | a87a6c96025bea4123859d5f739bbd90ea5fcd30 | [
"MIT"
] | 1 | 2021-03-17T07:55:33.000Z | 2021-03-17T07:55:33.000Z | import json
import numpy as np
import pandas as pd
import os
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Activation
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import C... | 39.545455 | 101 | 0.749138 | import json
import numpy as np
import pandas as pd
import os
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Activation
from tensorflow.keras.optimizers import SGD
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import C... | true | true |
1c02e6e55ab6a08cefe0fcdb6562fd746b23efc1 | 5,104 | py | Python | configs/example/ruby_direct_test.py | majid169/gem5-RFDB | a8950687b8cb6a701a387fca4409ff273facb459 | [
"BSD-3-Clause"
] | 3 | 2020-04-18T07:01:12.000Z | 2021-04-11T04:14:56.000Z | configs/example/ruby_direct_test.py | majid169/gem5-RFDB | a8950687b8cb6a701a387fca4409ff273facb459 | [
"BSD-3-Clause"
] | null | null | null | configs/example/ruby_direct_test.py | majid169/gem5-RFDB | a8950687b8cb6a701a387fca4409ff273facb459 | [
"BSD-3-Clause"
] | 3 | 2019-02-14T13:54:31.000Z | 2021-07-09T11:06:26.000Z | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source co... | 38.089552 | 79 | 0.711403 |
import m5
from m5.objects import *
from m5.defines import buildEnv
from m5.util import addToPath
import os, optparse, sys
addToPath('../')
from common import Options
from ruby import Ruby
config_path = os.path.dirname(os.path.abspath(__file__))
config_root = os.path.dirname(config_path)
m5_root = os.path.dirname(co... | false | true |
1c02e79d16b0d422b72aa1a43af3b1585478b61f | 18,548 | py | Python | stix_generator/enums.py | JeremieBou/stix_generator | 48db1f724f43e332cbfb042daf07aaf0ad3ce8fc | [
"MIT"
] | null | null | null | stix_generator/enums.py | JeremieBou/stix_generator | 48db1f724f43e332cbfb042daf07aaf0ad3ce8fc | [
"MIT"
] | null | null | null | stix_generator/enums.py | JeremieBou/stix_generator | 48db1f724f43e332cbfb042daf07aaf0ad3ce8fc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#STIX open vocabulary and values
#simulate enums
TYPES = [
"attack-pattern",
"campaign",
"course-of-action",
"identity",
"indicator",
"intrusion-set",
"malware",
"observed-data",
"report",
"threat-actor",
"tool",
"vulnerability",
]
GENERATABLE_T... | 20.724022 | 401 | 0.526256 |
TYPES = [
"attack-pattern",
"campaign",
"course-of-action",
"identity",
"indicator",
"intrusion-set",
"malware",
"observed-data",
"report",
"threat-actor",
"tool",
"vulnerability",
]
GENERATABLE_TYPES = [
"attack-pattern",
"campaign",
"course-of-action",
... | true | true |
1c02e7d97c33bb919a56553dc772c960aa48e011 | 1,059 | py | Python | hfapp/models/validators.py | PsiRadish/HeroesFeast | 0c700e3e1e495671c70595bdb8927758f1fc6754 | [
"MIT"
] | null | null | null | hfapp/models/validators.py | PsiRadish/HeroesFeast | 0c700e3e1e495671c70595bdb8927758f1fc6754 | [
"MIT"
] | 3 | 2020-02-11T22:01:47.000Z | 2021-06-10T19:51:31.000Z | hfapp/models/validators.py | PsiRadish/HeroesFeast | 0c700e3e1e495671c70595bdb8927758f1fc6754 | [
"MIT"
] | null | null | null |
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import gettext_lazy as _
@deconstructible
class InListValidator:
#{
valid_list = []
message = _('Value %(value)s is not in the list of accepted values: %(valid_list)s')
... | 28.621622 | 88 | 0.613787 |
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import gettext_lazy as _
@deconstructible
class InListValidator:
valid_list = []
message = _('Value %(value)s is not in the list of accepted values: %(valid_list)s')
c... | true | true |
1c02e8a2ecf1c11881ee1d70e5a7ad203fa0e344 | 930 | py | Python | aws/api_gateway2/lambda_function.py | Phantasmanoria/KB_1807 | 06e7722dc9df0355bc99a9cf137ba03c0d55cb42 | [
"MIT"
] | null | null | null | aws/api_gateway2/lambda_function.py | Phantasmanoria/KB_1807 | 06e7722dc9df0355bc99a9cf137ba03c0d55cb42 | [
"MIT"
] | null | null | null | aws/api_gateway2/lambda_function.py | Phantasmanoria/KB_1807 | 06e7722dc9df0355bc99a9cf137ba03c0d55cb42 | [
"MIT"
] | null | null | null | import json, boto3
import decimal
from boto3.dynamodb.conditions import Key, Attr
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else:
return int(o)
return su... | 30 | 99 | 0.565591 | import json, boto3
import decimal
from boto3.dynamodb.conditions import Key, Attr
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
if o % 1 > 0:
return float(o)
else:
return int(o)
return su... | false | true |
1c02e8d8acc5274cd11b1b9d6a4de48ea2cc748e | 1,506 | py | Python | script/units/testease.py | xzfn/toy | 5d4f6e631c662634a059a4a178174032b01cc81a | [
"MIT"
] | null | null | null | script/units/testease.py | xzfn/toy | 5d4f6e631c662634a059a4a178174032b01cc81a | [
"MIT"
] | null | null | null | script/units/testease.py | xzfn/toy | 5d4f6e631c662634a059a4a178174032b01cc81a | [
"MIT"
] | null | null | null | import math
import vmath
from vmathlib import vcolor, vutil
import drawutil
from unit_manager import Unit
class Testease(Unit):
def tick(self, delta_time):
self._draw_ease_panel(vmath.Vector3())
def _draw_ease_panel(self, panel_position):
exp = 3
ease_funcs = [
vutil.alpha_ease_none,
vutil.alpha_eas... | 30.734694 | 80 | 0.741036 | import math
import vmath
from vmathlib import vcolor, vutil
import drawutil
from unit_manager import Unit
class Testease(Unit):
def tick(self, delta_time):
self._draw_ease_panel(vmath.Vector3())
def _draw_ease_panel(self, panel_position):
exp = 3
ease_funcs = [
vutil.alpha_ease_none,
vutil.alpha_eas... | true | true |
1c02e9be5d1fa66d85ce1b990754cc307948aa29 | 308 | py | Python | open_project_files.py | jasonivey/scripts | 09f9702e5ce62abbb7699aae16b45b33711fe856 | [
"MIT"
] | null | null | null | open_project_files.py | jasonivey/scripts | 09f9702e5ce62abbb7699aae16b45b33711fe856 | [
"MIT"
] | null | null | null | open_project_files.py | jasonivey/scripts | 09f9702e5ce62abbb7699aae16b45b33711fe856 | [
"MIT"
] | null | null | null | import os, sys, re, Utils, Perforce
def IsProjectFile( file ):
return not re.search('wsfiles', file, re.I) and re.match(r'^.*\.vcproj$', file, re.I)
if __name__ == '__main__':
for file in Utils.RecurseDirectory( os.getcwd(), IsProjectFile, False ):
Perforce.OpenForEdit(file)
| 30.8 | 90 | 0.642857 | import os, sys, re, Utils, Perforce
def IsProjectFile( file ):
return not re.search('wsfiles', file, re.I) and re.match(r'^.*\.vcproj$', file, re.I)
if __name__ == '__main__':
for file in Utils.RecurseDirectory( os.getcwd(), IsProjectFile, False ):
Perforce.OpenForEdit(file)
| true | true |
1c02ea6505616d7b98705512a198b87e43f860b4 | 367 | py | Python | static_values.py | AnotherCat/dtc-level-2-game | 0f68678c975fddf75ea28b23ba4caeb9815edb4d | [
"MIT"
] | null | null | null | static_values.py | AnotherCat/dtc-level-2-game | 0f68678c975fddf75ea28b23ba4caeb9815edb4d | [
"MIT"
] | null | null | null | static_values.py | AnotherCat/dtc-level-2-game | 0f68678c975fddf75ea28b23ba4caeb9815edb4d | [
"MIT"
] | null | null | null | # Constant values that are shared accross files
PLAYER_JUMP_SPEED = 12
BOOSTED_PLAYER_JUMP_SPEED = 18
PLAYER_MOVEMENT_SPEED = 4
GRAVITY = 0.7
TILE_WIDTH = 128
TILE_HEIGHT = TILE_WIDTH
WIDTH = 10 * TILE_WIDTH
HEIGHT = 6 * TILE_HEIGHT
VIEWPORT_MARGIN = 280
TITLE = "Ice Game"
MAX_LEVEL = 3
START_LEVEL = 1 # 2 for t... | 18.35 | 72 | 0.760218 |
PLAYER_JUMP_SPEED = 12
BOOSTED_PLAYER_JUMP_SPEED = 18
PLAYER_MOVEMENT_SPEED = 4
GRAVITY = 0.7
TILE_WIDTH = 128
TILE_HEIGHT = TILE_WIDTH
WIDTH = 10 * TILE_WIDTH
HEIGHT = 6 * TILE_HEIGHT
VIEWPORT_MARGIN = 280
TITLE = "Ice Game"
MAX_LEVEL = 3
START_LEVEL = 1 | true | true |
1c02eac35fecabd8f5c49c17b7f261510b5b4621 | 2,018 | py | Python | benchmarks/benchmark_observer.py | samtx/pass-predictor | 6577f75cd7d64bd3c12a9512880d4b29c2682b4c | [
"MIT"
] | null | null | null | benchmarks/benchmark_observer.py | samtx/pass-predictor | 6577f75cd7d64bd3c12a9512880d4b29c2682b4c | [
"MIT"
] | null | null | null | benchmarks/benchmark_observer.py | samtx/pass-predictor | 6577f75cd7d64bd3c12a9512880d4b29c2682b4c | [
"MIT"
] | null | null | null | # Write the benchmarking functions here.
# See "Writing benchmarks" in the asv docs for more information.
import datetime
import cProfile
import pstats
from passpredict import Location, Observer, SGP4Propagator, TLE
# Setup objects
start = datetime.datetime(2020, 7, 14, tzinfo=datetime.timezone.utc)
end = start + da... | 29.676471 | 78 | 0.663033 | import datetime
import cProfile
import pstats
from passpredict import Location, Observer, SGP4Propagator, TLE
start = datetime.datetime(2020, 7, 14, tzinfo=datetime.timezone.utc)
end = start + datetime.timedelta(days=10)
satid = 'ISS'
tle_lines = (
"1 25544U 98067A 20196.51422950 -.00000046 00000-0 72206-5 0... | true | true |
1c02ec4d88bd380d22a706f76aca05e456add095 | 31,960 | py | Python | neurokernel/LPU/utils/visualizer.py | yiyin/neurodriver | 34e6874a1cf35633cda1191920cbaeac5d25dc9b | [
"BSD-3-Clause"
] | null | null | null | neurokernel/LPU/utils/visualizer.py | yiyin/neurodriver | 34e6874a1cf35633cda1191920cbaeac5d25dc9b | [
"BSD-3-Clause"
] | null | null | null | neurokernel/LPU/utils/visualizer.py | yiyin/neurodriver | 34e6874a1cf35633cda1191920cbaeac5d25dc9b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
LPU output visualization.
"""
import collections
from collections import OrderedDict
import itertools
import os
import h5py
from future.utils import itervalues, iteritems
import matplotlib
from matplotlib import cm
from matplotlib.colors import Normalize
import matplotlib.pyplot as plt
plt.... | 41.452659 | 114 | 0.488486 |
import collections
from collections import OrderedDict
import itertools
import os
import h5py
from future.utils import itervalues, iteritems
import matplotlib
from matplotlib import cm
from matplotlib.colors import Normalize
import matplotlib.pyplot as plt
plt.ioff() from matplotlib.animation import FFMpegFileWriter... | true | true |
1c02ef3de8e1e484dc478b2be8cdb4bb6ad40956 | 513 | py | Python | venv/Lib/site-packages/halcon/interop.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/halcon/interop.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/halcon/interop.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | """
************************************************************
numpy_interop.py - inter operation utility
************************************************************
Project: HALCON/Python
************************************************************
(c) 1996-2020 by MVTec Software GmbH
Software by: MVTec Softwar... | 17.689655 | 60 | 0.438596 |
from .ffi import HError
__all__ = [
'HInteropError',
]
class HInteropError(HError):
pass
| true | true |
1c02efe4489e5676eccfe3aa8e559ebed526d299 | 2,424 | py | Python | homeassistant/components/device_tracker/xiaomi_miio.py | MoshonkaKita/Golovastik | df2ab62ce9b245b9b0f976af8c9868d9b416733b | [
"Apache-2.0"
] | 3 | 2019-01-31T13:41:37.000Z | 2020-05-20T14:22:18.000Z | homeassistant/components/device_tracker/xiaomi_miio.py | MoshonkaKita/Golovastik | df2ab62ce9b245b9b0f976af8c9868d9b416733b | [
"Apache-2.0"
] | null | null | null | homeassistant/components/device_tracker/xiaomi_miio.py | MoshonkaKita/Golovastik | df2ab62ce9b245b9b0f976af8c9868d9b416733b | [
"Apache-2.0"
] | 1 | 2020-11-04T07:35:32.000Z | 2020-11-04T07:35:32.000Z | """
Support for Xiaomi Mi WiFi Repeater 2.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/device_tracker.xiaomi_miio/
"""
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScan... | 29.925926 | 77 | 0.668317 | import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST, CONF_TOKEN
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['python-miio==0.4.3', 'construct==2.9.45']
_LOGGER = lo... | true | true |
1c02f01c17a890890a21c35a1d8fcb064d0d8118 | 331 | py | Python | output/models/ms_data/regex/re_l57_xsd/re_l57.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/regex/re_l57_xsd/re_l57.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/regex/re_l57_xsd/re_l57.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
@dataclass
class Doc:
class Meta:
name = "doc"
elem: List[str] = field(
default_factory=list,
metadata={
"type": "Element",
"namespace": "",
"pattern": r"\p{IsBraillePatterns}+",
... | 18.388889 | 49 | 0.534743 | from dataclasses import dataclass, field
from typing import List
@dataclass
class Doc:
class Meta:
name = "doc"
elem: List[str] = field(
default_factory=list,
metadata={
"type": "Element",
"namespace": "",
"pattern": r"\p{IsBraillePatterns}+",
... | true | true |
1c02f032bf23c012f9135b89f88c5e27c6d9bf56 | 588 | py | Python | Class 12/Python Programs/File Handling/que 15 c/que 15 ncert.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | Class 12/Python Programs/File Handling/que 15 c/que 15 ncert.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | Class 12/Python Programs/File Handling/que 15 c/que 15 ncert.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | import pickle
fh=open("roman.data","wb+")
dic={}
n=int(input("Enter No. Of Terms :- "))
print()
for i in range(n):
rom=str(input("Enter Number in roman :-"))
dec=int(input("Enter Number in Decimal :- "))
dic[dec]=rom
print()
print("Final Dictonary :- ",dic)
pickle.dump(dic,fh)
fh.close()
pr... | 23.52 | 77 | 0.57483 | import pickle
fh=open("roman.data","wb+")
dic={}
n=int(input("Enter No. Of Terms :- "))
print()
for i in range(n):
rom=str(input("Enter Number in roman :-"))
dec=int(input("Enter Number in Decimal :- "))
dic[dec]=rom
print()
print("Final Dictonary :- ",dic)
pickle.dump(dic,fh)
fh.close()
pr... | true | true |
1c02f0479d70071a99a0d8224a17eab14e8b97ef | 10,134 | py | Python | save_results_oi.py | enesmsahin/ML_Decoder | a6aef44c029d6ee69c507e4609a86093a25f219f | [
"MIT"
] | null | null | null | save_results_oi.py | enesmsahin/ML_Decoder | a6aef44c029d6ee69c507e4609a86093a25f219f | [
"MIT"
] | null | null | null | save_results_oi.py | enesmsahin/ML_Decoder | a6aef44c029d6ee69c507e4609a86093a25f219f | [
"MIT"
] | null | null | null | import json
import os
import os.path as op
import argparse
import time
import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
from src_files.helper_functions.bn_fusion import fuse_bn_recursively
from src_files.models import create_model
import matplotlib
from src_files.models.tr... | 44.643172 | 168 | 0.617032 | import json
import os
import os.path as op
import argparse
import time
import torch
import torch.nn.parallel
import torch.optim
import torch.utils.data.distributed
from src_files.helper_functions.bn_fusion import fuse_bn_recursively
from src_files.models import create_model
import matplotlib
from src_files.models.tr... | true | true |
1c02f1d6c5448976432463f8472ceec5dbbfad06 | 873 | py | Python | atom/nucleus/python/test/test_client_address.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_client_address.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_client_address.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Atom API
The Hydrogen Atom API # noqa: E501
OpenAPI spec version: 1.7.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_... | 21.292683 | 81 | 0.69874 |
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_api.models.client_address import ClientAddress from nucleus_api.rest import ApiException
class TestClientAddress(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testClient... | true | true |
1c02f201db5f26fe718d5e1e58bcc393703e2041 | 10,825 | py | Python | sdk/python/pulumi_aws/ses/domain_dkim.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-11-10T16:33:40.000Z | 2021-11-10T16:33:40.000Z | sdk/python/pulumi_aws/ses/domain_dkim.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ses/domain_dkim.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 42.786561 | 138 | 0.64351 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['DomainDkimArgs', 'DomainDkim']
@pulumi.input_type
class DomainDkimArgs:
def __init__(__self__, *,
domain: pulumi.Input[str]):
pul... | true | true |
1c02f2197475dda8600d59603ad002609ea51799 | 1,321 | py | Python | player.py | JaredsGames/Pig | 38971e81e2b515f9558900a9fc86e90e426fdacb | [
"MIT"
] | null | null | null | player.py | JaredsGames/Pig | 38971e81e2b515f9558900a9fc86e90e426fdacb | [
"MIT"
] | null | null | null | player.py | JaredsGames/Pig | 38971e81e2b515f9558900a9fc86e90e426fdacb | [
"MIT"
] | null | null | null | """
This contains the player entity
"""
# Jared Dyreson
# CPSC 386-01
# 2021-10-02
# jareddyreson@csu.fullerton.edu
# @JaredDyreson
#
# Lab 00-02
#
# Some filler text
#
import math
import textwrap
from die import Die
class Player:
"""
Player entity that will be used to interact with the
game board
... | 21.655738 | 95 | 0.514005 |
import math
import textwrap
from die import Die
class Player:
def __init__(self, name: str, is_bot: bool):
if not (isinstance(name, str) and isinstance(is_bot, bool)):
raise ValueError(
f'mismatched type for Player constructor: Player({type(name)}, {type(is_bot)})'
... | true | true |
1c02f300272a1d993964149e7cc28511ae56135c | 299 | py | Python | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | 1 | 2020-08-03T07:54:59.000Z | 2020-08-03T07:54:59.000Z | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | utils/json_mappers/stage_json_mapper.py | kuyu12/pygame_fight_game | 3bbc286b9f33c6d6d9db9bea21f9b7af15247df5 | [
"MIT"
] | null | null | null | class StageMapper:
STAGE_NAME = "stage_name"
STAGE_IMAGE = "stage_image"
ROOD_MAP = "road_map"
USER_START_POSITION = "user_start_position"
class SignalMapper:
COLLISION_UPDATE = "collision_update"
SCREEN_TYPE_CHANGE = "screen_type_change"
COMBO_ATTACK = "combo_attack"
| 24.916667 | 47 | 0.73913 | class StageMapper:
STAGE_NAME = "stage_name"
STAGE_IMAGE = "stage_image"
ROOD_MAP = "road_map"
USER_START_POSITION = "user_start_position"
class SignalMapper:
COLLISION_UPDATE = "collision_update"
SCREEN_TYPE_CHANGE = "screen_type_change"
COMBO_ATTACK = "combo_attack"
| true | true |
1c02f3107ec4bb658212cd0b609c245e20cf5afb | 1,872 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/requestid_4bb823de2302ea46c48b53652c8059b5.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/requestid_4bb823de2302ea46c48b53652c8059b5.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/requestid_4bb823de2302ea46c48b53652c8059b5.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 36 | 143 | 0.715278 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class RequestId(Base):
__slots__ = ()
_SDM_NAME = 'requestId'
_SDM_ATT_MAP = {
'Count': 'count',
}
_SDM_ENUM_MAP = {
}
def __init__(self, parent, list_op=False):
... | true | true |
1c02f31b5de5705c6748476436c3a04c7ce94a4a | 15,699 | py | Python | src/test-apps/happy/test-templates/WeavePairing.py | yunhanw-google/openweave-core | 87acdab7064cec9f3c795ee64fd4b9702d887580 | [
"Apache-2.0"
] | null | null | null | src/test-apps/happy/test-templates/WeavePairing.py | yunhanw-google/openweave-core | 87acdab7064cec9f3c795ee64fd4b9702d887580 | [
"Apache-2.0"
] | 1 | 2019-03-26T04:47:32.000Z | 2019-03-26T04:47:32.000Z | src/test-apps/happy/test-templates/WeavePairing.py | yunhanw-google/openweave-core | 87acdab7064cec9f3c795ee64fd4b9702d887580 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2015-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | 38.667488 | 154 | 0.614434 |
import os
import random
import re
import sys
from happy.ReturnMsg import ReturnMsg
from happy.Utils import *
from happy.utils.IP import IP
from happy.HappyNode import HappyNode
from happy.HappyNetwork import HappyNetwork
from WeaveTest import WeaveTest
options = {"quiet": False,
"mobile": None,
... | false | true |
1c02f354094250b83537f4d87f8c5912e3e49c23 | 32,240 | py | Python | ryu/tests/unit/lib/test_ofctl.py | elahejalalpour/ELRyu | 70678de3f8a493989daef7e9aecbc0a90d7f6be9 | [
"Apache-2.0"
] | 1 | 2015-08-25T08:14:21.000Z | 2015-08-25T08:14:21.000Z | ryu/tests/unit/lib/test_ofctl.py | elahejalalpour/ELRyu | 70678de3f8a493989daef7e9aecbc0a90d7f6be9 | [
"Apache-2.0"
] | null | null | null | ryu/tests/unit/lib/test_ofctl.py | elahejalalpour/ELRyu | 70678de3f8a493989daef7e9aecbc0a90d7f6be9 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39.269184 | 77 | 0.495316 |
import unittest
import logging
import netaddr
import functools
import inspect
from nose.tools import *
from ryu.lib import addrconv
from ryu.lib import ofctl_v1_0
from ryu.ofproto import ofproto_v1_0, ofproto_v1_0_parser
from ryu.lib import ofctl_v1_2
from ryu.ofproto import ofproto_v1_2, ofproto_v1_2_parser
from ry... | true | true |
1c02f4341ac9a09261a2e1421917e9706b8b2503 | 18,243 | py | Python | twilio/rest/ip_messaging/v2/service/channel/member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | 1 | 2021-02-24T04:59:03.000Z | 2021-02-24T04:59:03.000Z | twilio/rest/ip_messaging/v2/service/channel/member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | null | null | null | twilio/rest/ip_messaging/v2/service/channel/member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | 1 | 2018-12-09T00:53:21.000Z | 2018-12-09T00:53:21.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import ... | 33.290146 | 110 | 0.618265 |
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class MemberLis... | true | true |
1c02f5263d1e71942c6013e6f4521cc80a80072c | 13,206 | py | Python | utils/shared/base_utils2.py | kristiker/source1import | c0f22434c37f32acd598d5a5115dfbc2103d8277 | [
"MIT"
] | 9 | 2021-08-29T19:24:55.000Z | 2022-02-11T18:25:57.000Z | utils/shared/base_utils2.py | kristiker/source1import | c0f22434c37f32acd598d5a5115dfbc2103d8277 | [
"MIT"
] | 4 | 2022-02-04T00:31:13.000Z | 2022-03-18T16:15:58.000Z | utils/shared/base_utils2.py | kristiker/source1import | c0f22434c37f32acd598d5a5115dfbc2103d8277 | [
"MIT"
] | 1 | 2021-11-22T16:46:59.000Z | 2021-11-22T16:46:59.000Z |
from contextlib import suppress
from pathlib import Path
from enum import Enum
from types import GeneratorType
try:
from keyvalues1 import KV
except ImportError:
from shared.keyvalues1 import KV
import argparse
arg_parser = argparse.ArgumentParser(usage = "-src1gameinfodir <s1gameinfodir> -game <s2 mod> [<src... | 35.691892 | 178 | 0.632667 |
from contextlib import suppress
from pathlib import Path
from enum import Enum
from types import GeneratorType
try:
from keyvalues1 import KV
except ImportError:
from shared.keyvalues1 import KV
import argparse
arg_parser = argparse.ArgumentParser(usage = "-src1gameinfodir <s1gameinfodir> -game <s2 mod> [<src... | true | true |
1c02f53a58ae22af625a68c6bb2b214b1861217e | 4,836 | py | Python | Tensile/Tests/nightly/convolution_config/YamlBuilder/YamlBuilder.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/YamlBuilder/YamlBuilder.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | Tensile/Tests/nightly/convolution_config/YamlBuilder/YamlBuilder.py | zjunweihit/Tensile | 68b73083c92eecc1b04eec1f006f28aea5628030 | [
"MIT"
] | null | null | null | import os
import Tensile.Tensile as Tensile
class YamlBuilder:
@staticmethod
def catFile(outfile,fname):
with open(fname) as infile:
outfile.write(infile.read())
def write_problem_sizes(conv, outfile):
outfile.write(" - ProblemSizes:\n")
if conv.spatial:
... | 37.78125 | 103 | 0.641646 | import os
import Tensile.Tensile as Tensile
class YamlBuilder:
@staticmethod
def catFile(outfile,fname):
with open(fname) as infile:
outfile.write(infile.read())
def write_problem_sizes(conv, outfile):
outfile.write(" - ProblemSizes:\n")
if conv.spatial:
... | true | true |
1c02f6b2921bdc121ade382e92fc2a543c2b9260 | 8,161 | py | Python | topaz/objects/bignumobject.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | topaz/objects/bignumobject.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | topaz/objects/bignumobject.py | mswart/topaz | 4bc02d6f4bf29c20f045223ecb6ae8a5cc9df2ae | [
"BSD-3-Clause"
] | null | null | null | from rpython.rlib.rbigint import rbigint
from rpython.rlib.rfloat import INFINITY
from rpython.rtyper.lltypesystem import lltype, rffi
from topaz.module import ClassDef
from topaz.objects.integerobject import W_IntegerObject
from topaz.objects.numericobject import W_NumericObject
class W_BignumObject(W_IntegerObject... | 36.271111 | 98 | 0.610955 | from rpython.rlib.rbigint import rbigint
from rpython.rlib.rfloat import INFINITY
from rpython.rtyper.lltypesystem import lltype, rffi
from topaz.module import ClassDef
from topaz.objects.integerobject import W_IntegerObject
from topaz.objects.numericobject import W_NumericObject
class W_BignumObject(W_IntegerObject... | true | true |
1c02f710c01ab902a04f58ab3031eac4f886af3b | 12,060 | py | Python | sdks/python/apache_beam/runners/portability/expansion_service_test.py | ajothomas/beam | 4774c1caf3dac3b6a7dd161f82559a26fa380920 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2019-07-27T11:54:33.000Z | 2021-06-06T11:53:36.000Z | sdks/python/apache_beam/runners/portability/expansion_service_test.py | ajothomas/beam | 4774c1caf3dac3b6a7dd161f82559a26fa380920 | [
"Apache-2.0",
"BSD-3-Clause"
] | 12 | 2019-04-15T15:27:23.000Z | 2019-07-01T18:13:10.000Z | sdks/python/apache_beam/runners/portability/expansion_service_test.py | ajothomas/beam | 4774c1caf3dac3b6a7dd161f82559a26fa380920 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-21T16:27:57.000Z | 2019-11-21T16:27:57.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 us... | 33.407202 | 92 | 0.753234 |
import argparse
import logging
import signal
import sys
import typing
import grpc
import apache_beam as beam
import apache_beam.transforms.combiners as combine
from apache_beam.coders import RowCoder
from apache_beam.pipeline import PipelineOptions
from apache_beam.portability.api import beam_artifact_api_pb2_grpc
f... | true | true |
1c02f751c377c905aa03dcf5e86d39f0ed54059a | 20,896 | py | Python | python/__init__.py | Donfyffe/panda | 9c371ca62219297648da74bc86a57017afc641f0 | [
"MIT"
] | 20 | 2020-12-04T12:20:57.000Z | 2022-03-31T00:40:15.000Z | python/__init__.py | Donfyffe/panda | 9c371ca62219297648da74bc86a57017afc641f0 | [
"MIT"
] | 6 | 2020-03-06T18:13:55.000Z | 2020-07-20T05:10:20.000Z | python/__init__.py | Donfyffe/panda | 9c371ca62219297648da74bc86a57017afc641f0 | [
"MIT"
] | 113 | 2020-10-08T07:37:05.000Z | 2022-02-12T04:26:34.000Z | # python library to interface with panda
import datetime
import struct
import hashlib
import socket
import usb1
import os
import time
import traceback
import sys
from .dfu import PandaDFU # pylint: disable=import-error
from .flash_release import flash_release # noqa pylint: disable=import-error
from .update import en... | 31.517345 | 112 | 0.626005 | import datetime
import struct
import hashlib
import socket
import usb1
import os
import time
import traceback
import sys
from .dfu import PandaDFU from .flash_release import flash_release from .update import ensure_st_up_to_date from .serial import PandaSerial from .isotp import isotp_send, isotp_recv
__version_... | true | true |
1c02f7e8ea784f484265f482bb2eaf9d943e2d68 | 898 | py | Python | src/asm/cmsui/cms.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/cmsui/cms.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/cmsui/cms.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | import asm.cms.cms
import asm.cms.interfaces
import asm.cmsui.form
import grok
import simplejson
import zope.catalog.interfaces
import zope.component
import zope.interface
grok.context(asm.cms.cms.CMS)
class SelectProfile(asm.cmsui.form.EditForm):
form_fields = grok.AutoFields(asm.cms.interfaces.IProfileSelect... | 22.45 | 71 | 0.743875 | import asm.cms.cms
import asm.cms.interfaces
import asm.cmsui.form
import grok
import simplejson
import zope.catalog.interfaces
import zope.component
import zope.interface
grok.context(asm.cms.cms.CMS)
class SelectProfile(asm.cmsui.form.EditForm):
form_fields = grok.AutoFields(asm.cms.interfaces.IProfileSelect... | true | true |
1c02f8fa8fc081230d08378891264126e4e050b7 | 2,562 | py | Python | dateparser/data/date_translation_data/kab.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/kab.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/date_translation_data/kab.py | Rodp63/dateparser | 938a9573234679b603210bd47cc93eb258b1f1df | [
"BSD-3-Clause"
] | null | null | null | info = {
"name": "kab",
"date_order": "DMY",
"january": [
"yen",
"yennayer"
],
"february": [
"fur",
"fuṛar"
],
"march": [
"meɣ",
"meɣres"
],
"april": [
"yeb",
"yebrir"
],
"may": [
"may",
"mayyu"
... | 15.070588 | 26 | 0.263466 | info = {
"name": "kab",
"date_order": "DMY",
"january": [
"yen",
"yennayer"
],
"february": [
"fur",
"fuṛar"
],
"march": [
"meɣ",
"meɣres"
],
"april": [
"yeb",
"yebrir"
],
"may": [
"may",
"mayyu"
... | true | true |
1c02f979477e09d1285f7865c31b560b0b924b50 | 1,380 | py | Python | scripts/jeffreys_prior_binomial.py | VaibhaviMishra04/pyprobml | 53208f571561acd25e8608ac5d1eb5e2610f6cc0 | [
"MIT"
] | 2 | 2021-06-22T05:43:25.000Z | 2021-06-22T08:40:16.000Z | scripts/jeffreys_prior_binomial.py | Rebeca98/pyprobml | 2a4b9a267f64720cbba35dfa41af3e995ea006ca | [
"MIT"
] | 1 | 2021-04-22T15:46:27.000Z | 2021-04-22T15:46:27.000Z | scripts/jeffreys_prior_binomial.py | Rebeca98/pyprobml | 2a4b9a267f64720cbba35dfa41af3e995ea006ca | [
"MIT"
] | 1 | 2021-06-21T01:18:07.000Z | 2021-06-21T01:18:07.000Z | # jeffreys prior for bernoulli using 2 paramterizatiobs
# fig 1.9 of 'Bayeysian Modeling and Computation'
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
θ = np.linspace(0, 1, 100)
κ = (θ / (1-θ))
y = 2
n = 7
_, ax = plt.subplots(2, 2, figsize=(10, 5),
sharex='co... | 37.297297 | 85 | 0.585507 |
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
θ = np.linspace(0, 1, 100)
κ = (θ / (1-θ))
y = 2
n = 7
_, ax = plt.subplots(2, 2, figsize=(10, 5),
sharex='col', sharey='row')
ax[0, 0].set_title("Jeffreys' prior for Alice")
ax[0, 0].plot(θ, θ**(-0.5) * (1-θ)**(-0... | true | true |
1c02f9b6664803cf2ba64c8f548bcaab0a303bbf | 36 | py | Python | hello.py | Alfie0226/firstgip | 64d565fe7fa9cd01342e638ea643f26949e8044a | [
"Apache-2.0"
] | null | null | null | hello.py | Alfie0226/firstgip | 64d565fe7fa9cd01342e638ea643f26949e8044a | [
"Apache-2.0"
] | null | null | null | hello.py | Alfie0226/firstgip | 64d565fe7fa9cd01342e638ea643f26949e8044a | [
"Apache-2.0"
] | null | null | null | print('hello python')
print("nice")
| 12 | 21 | 0.694444 | print('hello python')
print("nice")
| true | true |
1c02fa0001d2b18571d363037fe44689d8858537 | 85 | py | Python | code/abc122_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc122_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc122_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | b = input()
print("A" if b == "T" else "T" if b == "A" else "G" if b == "C" else "C") | 42.5 | 73 | 0.458824 | b = input()
print("A" if b == "T" else "T" if b == "A" else "G" if b == "C" else "C") | true | true |
1c02fbe1590025617d6ef814292f8692c160c470 | 1,112 | py | Python | pyxrd/calculations/CSDS.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 27 | 2018-06-15T15:28:18.000Z | 2022-03-10T12:23:50.000Z | pyxrd/calculations/CSDS.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 22 | 2018-06-14T08:29:16.000Z | 2021-07-05T13:33:44.000Z | pyxrd/calculations/CSDS.py | PyXRD/pyxrd | 26bacdf64f3153fa74b8caa62e219b76d91a55c1 | [
"BSD-2-Clause"
] | 8 | 2019-04-13T13:03:51.000Z | 2021-06-19T09:29:11.000Z | # coding=UTF-8
# ex:ts=4:sw=4:et=on
# Copyright (c) 2013, Mathijs Dumon
# All rights reserved.
# Complete license can be found in the LICENSE file.
import numpy as np
from math import sqrt, log
from .math_tools import lognormal
def calculate_distribution(CSDS):
r"""
Returns a tuple containing a numpy array ... | 23.659574 | 71 | 0.616906 |
import numpy as np
from math import sqrt, log
from .math_tools import lognormal
def calculate_distribution(CSDS):
a = CSDS.alpha_scale * log(CSDS.average) + CSDS.alpha_offset
b = sqrt(CSDS.beta_scale * log(CSDS.average) + CSDS.beta_offset)
steps = int(CSDS.maximum - CSDS.minimum) + 1
maxT = 0
... | true | true |
1c02fc8debb7a5fca11b56402ca22fdc0e80b659 | 1,760 | py | Python | OHA/param_builders/framingham_param_builder.py | openhealthalgorithms/algorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 2 | 2017-01-08T11:00:04.000Z | 2017-01-21T17:38:11.000Z | OHA/param_builders/framingham_param_builder.py | fredhersch/openhealthalgorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 9 | 2017-08-20T13:59:28.000Z | 2018-01-20T11:20:12.000Z | OHA/param_builders/framingham_param_builder.py | openhealthalgorithms/algorithms | 97ce727079ea18607a4144ff1d053a208bbc6c6e | [
"Apache-2.0"
] | 1 | 2017-01-22T09:53:31.000Z | 2017-01-22T09:53:31.000Z | __author__ = 'indrajit'
__email__ = 'eendroroy@gmail.com'
class FraminghamParamsBuilder(object):
def __init__(self):
self.__gender = 'M'
self.__age = 40
self.__sbp = 140
self.__t_chol = None
self.__t_chol_unit = 'mg/dl'
self.__hdl_chol = None
self.__hdl_chol... | 27.076923 | 57 | 0.596591 | __author__ = 'indrajit'
__email__ = 'eendroroy@gmail.com'
class FraminghamParamsBuilder(object):
def __init__(self):
self.__gender = 'M'
self.__age = 40
self.__sbp = 140
self.__t_chol = None
self.__t_chol_unit = 'mg/dl'
self.__hdl_chol = None
self.__hdl_chol... | true | true |
1c02fe6c834207babc6018ff23434da637a5f946 | 26,454 | py | Python | src/azure-cli/azure/cli/command_modules/eventgrid/custom.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2019-12-12T19:55:26.000Z | 2019-12-12T19:55:26.000Z | src/azure-cli/azure/cli/command_modules/eventgrid/custom.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 2 | 2021-01-15T09:24:07.000Z | 2021-01-15T09:30:10.000Z | src/azure-cli/azure/cli/command_modules/eventgrid/custom.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2020-11-12T01:49:27.000Z | 2020-11-12T01:49:27.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 39.542601 | 120 | 0.689423 |
import re
from six.moves.urllib.parse import quote from knack.log import get_logger
from knack.util import CLIError
from msrestazure.tools import parse_resource_id
from dateutil.parser import parse
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.mgmt.eventgrid.models import (
... | true | true |
1c02feb4945764fc32134883b01e3671483f6906 | 2,265 | py | Python | tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/molecular/molecules/molecule/fixtures/cof/periodic_square.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | import pytest
import stk
from ...case_data import CaseData
@pytest.fixture(
scope='session',
params=(
lambda name: CaseData(
molecule=stk.ConstructedMolecule(
topology_graph=stk.cof.PeriodicSquare(
building_blocks=(
stk.Building... | 34.318182 | 71 | 0.392936 | import pytest
import stk
from ...case_data import CaseData
@pytest.fixture(
scope='session',
params=(
lambda name: CaseData(
molecule=stk.ConstructedMolecule(
topology_graph=stk.cof.PeriodicSquare(
building_blocks=(
stk.Building... | true | true |
1c02ff1cb423719cd9f8ea81bc9636984d56662b | 979 | py | Python | 295. Find Median from Data Stream.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 295. Find Median from Data Stream.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 295. Find Median from Data Stream.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | class MedianFinder(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.small = list() # store first half, the smaller numbers
self.large = list() # store second half, the larger numbers
def addNum(self, num):
"""
:type... | 25.763158 | 67 | 0.54954 | class MedianFinder(object):
def __init__(self):
self.small = list() self.large = list()
def addNum(self, num):
heapq.heappush(self.small, -num)
heapq.heappush(self.large, -heapq.heappop(self.small))
if len(self.small)+1 < len(self.large):
h... | true | true |
1c02ff3448daf372ea7c1c8fd3171af1c3af4a3e | 706 | py | Python | pyPLM/Network/__init__.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 7 | 2017-12-22T02:49:58.000Z | 2018-05-09T05:29:06.000Z | pyPLM/Network/__init__.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | null | null | null | pyPLM/Network/__init__.py | vtta2008/pipelineTool | 2431d2fc987e3b31f2a6a63427fee456fa0765a0 | [
"Apache-2.0"
] | 3 | 2019-03-11T21:54:52.000Z | 2019-11-25T11:23:17.000Z | # -*- coding: utf-8 -*-
"""
Script Name: __init__.py.py
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
from .NetworkAccessManager import NetworkAccessManager
from .NetworkCookie ... | 30.695652 | 111 | 0.466006 |
from .NetworkAccessManager import NetworkAccessManager
from .NetworkCookie import NetworkCookie
from .NetworkCookieJar import NetworkCookieJar
from .NetworkRequest import NetworkRequest
from .NetworkReply import NetworkReply
| true | true |
1c02ff66b6bec1f2bedbea49f06618122bdfae5d | 2,367 | py | Python | cf2cdm/cfunits.py | shoyer/cfgrib | fe11a1b638b1779e51da87eaa30f1f12b2d0911c | [
"Apache-2.0"
] | null | null | null | cf2cdm/cfunits.py | shoyer/cfgrib | fe11a1b638b1779e51da87eaa30f1f12b2d0911c | [
"Apache-2.0"
] | null | null | null | cf2cdm/cfunits.py | shoyer/cfgrib | fe11a1b638b1779e51da87eaa30f1f12b2d0911c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | 32.424658 | 93 | 0.678918 |
from __future__ import absolute_import, division, print_function, unicode_literals
import typing as T
PRESSURE_CONVERSION_RULES = {
('Pa', 'pascal', 'pascals'): 1.,
('hPa', 'hectopascal', 'hectopascals', 'hpascal', 'millibar', 'millibars', 'mbar'): 100.,
('decibar', 'dbar'): 10000.,
('bar', 'bars')... | true | true |
1c02ff69d19d1632f1ab42fa0fea23ee459540ea | 953 | py | Python | website/services/sobooks_service.py | ourcolour/sobookscrawler | aac4916ac3262c07ec8fc8868b61acae56169413 | [
"Apache-2.0"
] | 3 | 2020-06-23T05:07:06.000Z | 2021-01-12T08:43:26.000Z | website/services/sobooks_service.py | ourcolour/sobookscrawler | aac4916ac3262c07ec8fc8868b61acae56169413 | [
"Apache-2.0"
] | 1 | 2020-05-20T06:49:16.000Z | 2020-08-18T13:43:45.000Z | website/services/sobooks_service.py | ourcolour/sobookscrawler | aac4916ac3262c07ec8fc8868b61acae56169413 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
+-------------------------------------------------
@Author: cc
@Contact: yaochen@xjh.com
@Site: http://www.xjh.com
@Project: sobookscrawler
@File: sobooks_service.py
@Version:
@Time: 2019-06-26 17:02
@Description: ... | 24.435897 | 71 | 0.561385 |
__author__ = 'cc'
from website.entities.sobooks_model import SobooksModel
DEFAULT_PAGE_SIZE = 10
class SobooksService(object):
def find_by_isbn(self, isbn):
return SobooksModel.objects(__raw__={'isbn': isbn})
def find(self, criteria=None, page_no=1, page_size=DEFAULT_PAGE_SIZE):
if None is criteria:
cri... | true | true |
1c030021eade816d43b38b88853fe02091d196c0 | 24,114 | py | Python | mindspore/python/mindspore/dataset/text/utils.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/dataset/text/utils.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/dataset/text/utils.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 42.157343 | 120 | 0.647964 |
from enum import IntEnum
import numpy as np
import mindspore._c_dataengine as cde
from .validators import check_vocab, check_from_file, check_from_list, check_from_dict, check_from_dataset, \
check_from_dataset_sentencepiece, check_from_file_sentencepiece, check_save_model, \
check_from_file_vectors, check_t... | true | true |
1c0300689942e6ba3c459c5c879ed0f479e19b63 | 5,842 | py | Python | admin_export_action/introspection.py | instituciones-abiertas/django-admin-export-action | bb089180e418915e1bba31927554537249fbec78 | [
"MIT"
] | 5 | 2020-12-15T11:38:42.000Z | 2022-01-06T02:33:59.000Z | admin_export_action/introspection.py | instituciones-abiertas/django-admin-export-action | bb089180e418915e1bba31927554537249fbec78 | [
"MIT"
] | 2 | 2021-09-14T19:25:29.000Z | 2021-11-26T14:16:50.000Z | admin_export_action/introspection.py | instituciones-abiertas/django-admin-export-action | bb089180e418915e1bba31927554537249fbec78 | [
"MIT"
] | 2 | 2021-09-14T19:19:05.000Z | 2021-09-14T19:19:18.000Z | # coding: utf-8
from __future__ import unicode_literals, absolute_import
from itertools import chain
from django.contrib.contenttypes.models import ContentType
try:
from django.db.models.fields import FieldDoesNotExist
except:
from django.core.exceptions import FieldDoesNotExist
def _get_field_by_name(mode... | 34.163743 | 91 | 0.634372 |
from __future__ import unicode_literals, absolute_import
from itertools import chain
from django.contrib.contenttypes.models import ContentType
try:
from django.db.models.fields import FieldDoesNotExist
except:
from django.core.exceptions import FieldDoesNotExist
def _get_field_by_name(model_class, field_n... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.