hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64cf50d899f6068054dc86195c2c83bd7b97cd7a | 437 | py | Python | bball_intel/bball_intel/wsgi.py | ltiao/basketball-intelligence | c39a2794ca013a1bacd35ec2cbe778977c69834e | [
"MIT"
] | 2 | 2015-11-03T22:58:48.000Z | 2020-11-10T22:29:11.000Z | bball_intel/bball_intel/wsgi.py | ltiao/basketball-intelligence | c39a2794ca013a1bacd35ec2cbe778977c69834e | [
"MIT"
] | null | null | null | bball_intel/bball_intel/wsgi.py | ltiao/basketball-intelligence | c39a2794ca013a1bacd35ec2cbe778977c69834e | [
"MIT"
] | null | null | null | """
WSGI config for bball_intel project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bball_intel.settings.base")
from ... | 27.3125 | 78 | 0.796339 |
328b4849bc82c442f507edd85da54db85153e25c | 5,095 | py | Python | web/app/lib/ee/serializer.py | geary/claslite | 83c49cf98eceae633034b82d35ed7991d943b857 | [
"Unlicense"
] | null | null | null | web/app/lib/ee/serializer.py | geary/claslite | 83c49cf98eceae633034b82d35ed7991d943b857 | [
"Unlicense"
] | null | null | null | web/app/lib/ee/serializer.py | geary/claslite | 83c49cf98eceae633034b82d35ed7991d943b857 | [
"Unlicense"
] | null | null | null | """A serializer that encodes EE object trees as JSON DAGs."""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
import datetime
import json
import math
import md5
import numbers
import ee_exception
import encodable
# The datetime for the beginning of the Unix epoch.
_E... | 29.450867 | 79 | 0.646712 |
4957600b4049ff59dc9833fce02beaa0c28a287b | 687 | py | Python | pyomni/webdav/__init__.py | taxpon/pyomni | 74e256b6fc9cf0f4bcfc575bb8ed702f573a967f | [
"MIT"
] | 12 | 2015-12-20T13:13:22.000Z | 2022-01-29T05:32:35.000Z | pyomni/webdav/__init__.py | taxpon/pyomni | 74e256b6fc9cf0f4bcfc575bb8ed702f573a967f | [
"MIT"
] | 1 | 2020-09-15T15:59:07.000Z | 2020-09-15T15:59:07.000Z | pyomni/webdav/__init__.py | taxpon/pyomni | 74e256b6fc9cf0f4bcfc575bb8ed702f573a967f | [
"MIT"
] | 2 | 2016-04-20T15:59:57.000Z | 2019-06-16T12:42:10.000Z | # Copyright 2008 German Aerospace Center (DLR)
#
# 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... | 40.411765 | 75 | 0.754003 |
db17620aec64a26fc807d96571480b50551fa2f8 | 5,212 | py | Python | itr2-112a.py | gakudva/itr2 | 3352a36a1ca53fb15b1589423313a3e829e38c73 | [
"MIT"
] | null | null | null | itr2-112a.py | gakudva/itr2 | 3352a36a1ca53fb15b1589423313a3e829e38c73 | [
"MIT"
] | null | null | null | itr2-112a.py | gakudva/itr2 | 3352a36a1ca53fb15b1589423313a3e829e38c73 | [
"MIT"
] | null | null | null | import pytest
from selenium import webdriver
from selenium.webdriver.support.select import Select
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
from time import sleep
import sys
import csv
def test_automate_1... | 44.931034 | 113 | 0.739447 |
7eaca17c6ffbffcabf59b7ac489438a11b7d5c70 | 8,788 | py | Python | matflow_neper/utils.py | LightForm-group/matflow-neper | 58bf27ae956d9d95ad6c475c12be4ada7ea64177 | [
"MIT"
] | null | null | null | matflow_neper/utils.py | LightForm-group/matflow-neper | 58bf27ae956d9d95ad6c475c12be4ada7ea64177 | [
"MIT"
] | null | null | null | matflow_neper/utils.py | LightForm-group/matflow-neper | 58bf27ae956d9d95ad6c475c12be4ada7ea64177 | [
"MIT"
] | 1 | 2022-02-07T08:44:26.000Z | 2022-02-07T08:44:26.000Z | import re
import copy
from pathlib import Path
import numpy as np
from matflow_neper.from_damask_parse import validate_volume_element
def read_neper_tess_block(path, block_name):
"""Read a block from a Neper-compatible .tess or .tesr tessellation file.
Parameters
----------
path : Path or str
... | 32.072993 | 110 | 0.601274 |
5d432dcc7d51aedadee2498a4965081c2e543c3e | 2,343 | py | Python | tests/test_character.py | HoldenB/grunt-db | 4b8d43ee431e4788f8284449e4ea427b3c31f380 | [
"MIT"
] | null | null | null | tests/test_character.py | HoldenB/grunt-db | 4b8d43ee431e4788f8284449e4ea427b3c31f380 | [
"MIT"
] | null | null | null | tests/test_character.py | HoldenB/grunt-db | 4b8d43ee431e4788f8284449e4ea427b3c31f380 | [
"MIT"
] | null | null | null | import pytest
from grunt.db import get_db
def test_character_index(client, auth):
response = client.get('/')
assert b"Log In" in response.data
assert b"Register" in response.data
auth.login()
response = client.get('/')
assert b'Log Out' in response.data
assert b'test title' in response.da... | 28.228916 | 81 | 0.650021 |
3313416662782580871e59e12e907eaa2d027134 | 63 | py | Python | semantic_release/__main__.py | Agilicus/python-semantic-release | 74ac2b041aeae98310c4e5f60c1783bd84ed12b4 | [
"MIT"
] | 445 | 2015-07-27T17:48:25.000Z | 2022-03-31T15:48:10.000Z | semantic_release/__main__.py | Agilicus/python-semantic-release | 74ac2b041aeae98310c4e5f60c1783bd84ed12b4 | [
"MIT"
] | 338 | 2015-07-27T18:44:52.000Z | 2022-03-31T11:38:53.000Z | semantic_release/__main__.py | Agilicus/python-semantic-release | 74ac2b041aeae98310c4e5f60c1783bd84ed12b4 | [
"MIT"
] | 168 | 2015-07-28T20:32:52.000Z | 2022-03-31T10:45:06.000Z | from .cli import entry
if __name__ == "__main__":
entry()
| 12.6 | 26 | 0.650794 |
92320ddd007a00f52d51f35a1eef58b0d51b2268 | 25,247 | py | Python | main_gui.py | muhammadalics/Image-Manager-and-Editor | 41eee91a44926cf35aec350fae0a0b41f674d10b | [
"MIT"
] | 2 | 2020-12-21T09:46:45.000Z | 2021-04-26T03:50:51.000Z | main_gui.py | muhammadalics/Image-Manager-and-Editor | 41eee91a44926cf35aec350fae0a0b41f674d10b | [
"MIT"
] | null | null | null | main_gui.py | muhammadalics/Image-Manager-and-Editor | 41eee91a44926cf35aec350fae0a0b41f674d10b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_image_manager.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | 59.404706 | 107 | 0.724086 |
df5d38a4492da5899ef2cf2b3f7b2d13159090e3 | 2,042 | py | Python | resotolib/test/test_args.py | someengineering/resoto | ee17313f5376e9797ed305e7fdb62d40139a6608 | [
"Apache-2.0"
] | 126 | 2022-01-13T18:22:03.000Z | 2022-03-31T11:03:14.000Z | resotolib/test/test_args.py | someengineering/resoto | ee17313f5376e9797ed305e7fdb62d40139a6608 | [
"Apache-2.0"
] | 110 | 2022-01-13T22:27:55.000Z | 2022-03-30T22:26:50.000Z | resotolib/test/test_args.py | someengineering/resoto | ee17313f5376e9797ed305e7fdb62d40139a6608 | [
"Apache-2.0"
] | 8 | 2022-01-15T10:28:16.000Z | 2022-03-30T16:38:21.000Z | import os
from typing import List
from resotolib.args import get_arg_parser, ArgumentParser, convert, NoneType
from resotolib.logger import add_args as logging_add_args
from resotolib.jwt import add_args as jwt_add_args
def test_args():
assert ArgumentParser.args.does_not_exist is None
os.environ["RESOTO_PS... | 29.171429 | 76 | 0.661606 |
87fd51dcae2a11e33ad2280e4c37ef06f86ef5b6 | 405 | py | Python | input_data/migrations/0004_auto_20190615_0536.py | yudhapatria96/sidang | 67252d8ec11791444cfd2ed5330391775372afc6 | [
"bzip2-1.0.6"
] | null | null | null | input_data/migrations/0004_auto_20190615_0536.py | yudhapatria96/sidang | 67252d8ec11791444cfd2ed5330391775372afc6 | [
"bzip2-1.0.6"
] | 6 | 2019-12-05T00:12:52.000Z | 2022-02-10T09:47:41.000Z | input_data/migrations/0004_auto_20190615_0536.py | yudhapatria96/sidang | 67252d8ec11791444cfd2ed5330391775372afc6 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2 on 2019-06-14 22:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('input_data', '0003_auto_20190612_1313'),
]
operations = [
migrations.AlterField(
model_name='penjualanmodel',
name='bu... | 21.315789 | 51 | 0.619753 |
355b147890285d7d30ed88e3d7ffdcfd7bac5c60 | 2,409 | py | Python | Data clean-up and code/DOAJwrite2.py | ryregier/APCPrices | fa39a878cea8a1d89551f29382e86a16f9ebcb4d | [
"MIT"
] | 2 | 2018-02-13T21:41:08.000Z | 2018-02-14T21:38:20.000Z | Data clean-up and code/DOAJwrite2.py | ryregier/APCPrices | fa39a878cea8a1d89551f29382e86a16f9ebcb4d | [
"MIT"
] | 2 | 2018-03-06T00:01:53.000Z | 2018-03-06T14:20:00.000Z | Data clean-up and code/DOAJwrite2.py | ryregier/APCPrices | fa39a878cea8a1d89551f29382e86a16f9ebcb4d | [
"MIT"
] | 1 | 2018-11-07T16:34:12.000Z | 2018-11-07T16:34:12.000Z | import json
import re
import csv
def grab(x): #returning values and returning "unknown" if value error
if x is False or x == " " or x == "" or x == "No Information":
return "unknown"
else:
try:
return x
except:
return "unknown"
def apc_existence(x... | 29.378049 | 123 | 0.501453 |
f00b3c78ac21703e5cd79fa830feeb74373cdd3d | 15,571 | py | Python | watsononlinestore/tests/unit/test_watson_online_store.py | LiamFrailingWork/Gabe | 654ee86cdb7a68a8b132443dbda27ade74af99d8 | [
"Apache-2.0"
] | null | null | null | watsononlinestore/tests/unit/test_watson_online_store.py | LiamFrailingWork/Gabe | 654ee86cdb7a68a8b132443dbda27ade74af99d8 | [
"Apache-2.0"
] | null | null | null | watsononlinestore/tests/unit/test_watson_online_store.py | LiamFrailingWork/Gabe | 654ee86cdb7a68a8b132443dbda27ade74af99d8 | [
"Apache-2.0"
] | null | null | null | import unittest
import ddt
import mock
from watsononlinestore import watson_online_store
@ddt.ddt
class WOSTestCase(unittest.TestCase):
def setUp(self):
mock.Mock(watson_online_store.os.environ, return_value={})
self.slack_client = mock.Mock()
self.conv_client = mock.Mock()
self... | 42.083784 | 79 | 0.594053 |
632df0ce18078e1855841acee6b294801e3ae86b | 1,839 | py | Python | SpiffWorkflow/util/__init__.py | LipotesOps/octo-fibula | 14c7a2b5e4929c9f441f81485949d91ef9ab66a0 | [
"MIT"
] | 1 | 2020-12-23T06:14:27.000Z | 2020-12-23T06:14:27.000Z | SpiffWorkflow/util/__init__.py | LipotesOps/octo-fibula | 14c7a2b5e4929c9f441f81485949d91ef9ab66a0 | [
"MIT"
] | 7 | 2020-06-06T01:58:04.000Z | 2022-02-10T14:02:38.000Z | SpiffWorkflow/util/__init__.py | LipotesOps/octo-fibula | 14c7a2b5e4929c9f441f81485949d91ef9ab66a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
from builtins import range
def merge_dictionary(dst, src):
"""Recursive merge two dicts (vs .update which overwrites the hashes at the
root level)
Note: This updates dst.
Copied from checkmate.utils
"""
stack = [(dst, src)]
while sta... | 39.12766 | 79 | 0.442088 |
549459c168866d1211b731118b01cbb4bc11e89b | 2,185 | py | Python | dml/fileutils.py | RGBCube/dml | f551821545a062e15aea1f2c2444e6016748ea34 | [
"MIT"
] | 2 | 2022-03-19T19:15:28.000Z | 2022-03-19T19:15:32.000Z | dml/fileutils.py | RGBCube/dml | f551821545a062e15aea1f2c2444e6016748ea34 | [
"MIT"
] | null | null | null | dml/fileutils.py | RGBCube/dml | f551821545a062e15aea1f2c2444e6016748ea34 | [
"MIT"
] | null | null | null | import typing as t
from .encoder import encode, decode
from .errors import DecodeError
from .symbols import symbols as s
__all__ = ("decode_file", "encode_file")
def encode_file(fp: str, *, out: str = None) -> t.Optional[t.Generator[str, None, None]]:
"""Encodes a file to DML.
Arguments:
fp (str): ... | 32.132353 | 130 | 0.561556 |
1323852e084a9966cf10c942f17bd6440185d58b | 4,391 | py | Python | discatpy/internal/events.py | EmreTech/DisCatPy | 3fd7c147b5ca00afab4d9b6bb0767258ca680694 | [
"MIT"
] | 2 | 2022-03-25T03:11:52.000Z | 2022-03-25T03:19:54.000Z | discatpy/internal/events.py | EmreTech/DisCatPy | 3fd7c147b5ca00afab4d9b6bb0767258ca680694 | [
"MIT"
] | null | null | null | discatpy/internal/events.py | EmreTech/DisCatPy | 3fd7c147b5ca00afab4d9b6bb0767258ca680694 | [
"MIT"
] | 1 | 2022-03-27T10:45:43.000Z | 2022-03-27T10:45:43.000Z | """
The MIT License (MIT)
Copyright (c) 2022-present EmreTech
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, me... | 31.589928 | 90 | 0.661808 |
5801f5f3fde273e68be2e02326883061d8c3eb2a | 1,659 | py | Python | scripts/artifacts/crossArtifactTimeline.py | stark4n6/cLeapp | be7f7b2934e1a47b249121eca191be77ccea278b | [
"Apache-2.0"
] | 14 | 2021-05-10T14:35:53.000Z | 2022-02-10T03:05:18.000Z | scripts/artifacts/crossArtifactTimeline.py | stark4n6/cLeapp | be7f7b2934e1a47b249121eca191be77ccea278b | [
"Apache-2.0"
] | 3 | 2021-06-02T21:07:10.000Z | 2022-02-27T06:25:12.000Z | scripts/artifacts/crossArtifactTimeline.py | stark4n6/cLeapp | be7f7b2934e1a47b249121eca191be77ccea278b | [
"Apache-2.0"
] | 1 | 2021-05-10T15:20:46.000Z | 2021-05-10T15:20:46.000Z | import sqlite3
import textwrap
import os
from scripts.artifact_report import ArtifactHtmlReport
from scripts.cleapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly, usergen
def get_crossArtifactTimeline(files_found, report_folder, seeker, wrap_text):
report_folder = report_folder.... | 36.065217 | 108 | 0.700422 |
e741c4c435eafff2a23589109b71f5d40ef950b6 | 30,451 | py | Python | cfdm/domain.py | NCAS-CMS/cfdm | 8e6ac54c1a2966ad5c07cd51ef609005a1fd70cc | [
"MIT"
] | 22 | 2018-11-07T18:16:22.000Z | 2022-03-16T16:05:21.000Z | cfdm/domain.py | davidhassell/cfdm | 8e6ac54c1a2966ad5c07cd51ef609005a1fd70cc | [
"MIT"
] | 119 | 2019-04-08T08:00:24.000Z | 2022-03-22T08:21:22.000Z | cfdm/domain.py | davidhassell/cfdm | 8e6ac54c1a2966ad5c07cd51ef609005a1fd70cc | [
"MIT"
] | 8 | 2019-04-09T10:12:26.000Z | 2021-07-22T02:41:15.000Z | import logging
from . import Constructs, core, mixin
from .decorators import (
_display_or_return,
_inplace_enabled,
_inplace_enabled_define_and_cleanup,
)
logger = logging.getLogger(__name__)
class Domain(
mixin.FieldDomain,
mixin.NetCDFVariable,
mixin.NetCDFGeometry,
mixin.NetCDFGlobal... | 32.394681 | 189 | 0.528817 |
d6cc85dd214813311cf30af0327051242c501063 | 6,276 | py | Python | slixmpp/xmlstream/tostring.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | slixmpp/xmlstream/tostring.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | slixmpp/xmlstream/tostring.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
slixmpp.xmlstream.tostring
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module converts XML objects into Unicode strings and
intelligently includes namespaces only when necessary to
keep the output readable.
Part of Slixmpp: The Slick XMPP Library
:copyright: (c) 2011 Nat... | 34.295082 | 77 | 0.581581 |
0de45ccb3ad468d68df81d0bf8003eadd4308f66 | 838 | py | Python | test/test_add_group.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.group import Group
def test_add_group(app):
old_groups = app.group.get_groups_list()
group0 = Group(name="testgroup", header="testheader", footer="testfooter")
app.group.create(group0)
assert app.group.count() == len(old_groups) + 1
new_groups = app.group.get_gr... | 29.928571 | 93 | 0.704057 |
85f0fcc9132d69c597f1a68b0a3b90156364cadb | 8,627 | py | Python | Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributio... | 49.58046 | 154 | 0.704648 |
e505521c981f965c7eba04c77dfef7a46898d14f | 34,479 | py | Python | uf3/representation/bspline.py | henk789/uf3 | 60ad0de74417fa0b1406c261330dfec6b7d57cdb | [
"Apache-2.0"
] | 17 | 2021-10-01T14:52:16.000Z | 2022-02-11T13:10:03.000Z | uf3/representation/bspline.py | henk789/uf3 | 60ad0de74417fa0b1406c261330dfec6b7d57cdb | [
"Apache-2.0"
] | 3 | 2021-10-06T13:39:28.000Z | 2021-12-03T16:39:03.000Z | uf3/representation/bspline.py | henk789/uf3 | 60ad0de74417fa0b1406c261330dfec6b7d57cdb | [
"Apache-2.0"
] | 4 | 2022-01-27T08:49:00.000Z | 2022-03-22T11:55:35.000Z | """
This module provides the BSplineBasis class for defining BSpline basis sets
from knots and/or pair distance constraints.
"""
from typing import List, Dict, Tuple, Any, Collection
import os
import re
import warnings
import numpy as np
from scipy import interpolate
from uf3.data import composition
from uf3.represen... | 41.742131 | 79 | 0.567969 |
a122c699745c0cacee252df3ff5bddefd90c04c7 | 6,719 | py | Python | server/functions.py | PiRobotLm5G/Adeept_RaspTank | e3261645ba2688fac96fac5a58f925ccb5e4b0ef | [
"MIT"
] | null | null | null | server/functions.py | PiRobotLm5G/Adeept_RaspTank | e3261645ba2688fac96fac5a58f925ccb5e4b0ef | [
"MIT"
] | null | null | null | server/functions.py | PiRobotLm5G/Adeept_RaspTank | e3261645ba2688fac96fac5a58f925ccb5e4b0ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# File name : servo.py
# Description : Control Functions
# Author : William
# Date : 2020/03/17
import time
import RPi.GPIO as GPIO
import threading
from mpu6050 import mpu6050
import Adafruit_PCA9685
import os
import json
import ultra
import Kalman_filter
import move
move.s... | 24.885185 | 88 | 0.641018 |
ee6a6bfcf4946f69b81fb2b571117385e8ecd832 | 2,619 | py | Python | app/core/models.py | marinswk/recipe-app-api | c829ee4ce2650d6d377b1d04bd267702f315ea72 | [
"MIT"
] | null | null | null | app/core/models.py | marinswk/recipe-app-api | c829ee4ce2650d6d377b1d04bd267702f315ea72 | [
"MIT"
] | null | null | null | app/core/models.py | marinswk/recipe-app-api | c829ee4ce2650d6d377b1d04bd267702f315ea72 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
import uuid
import os
def recipe_image_file_path(instance, file_name):
"""generate file path for new recipe image"""
... | 28.78022 | 75 | 0.672394 |
dd08aa972995545c465823b4e7303fc544db9e4a | 1,391 | py | Python | spotty/commands/download.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | 1 | 2020-07-17T07:02:09.000Z | 2020-07-17T07:02:09.000Z | spotty/commands/download.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | spotty/commands/download.py | Inculus/spotty | 56863012668a6c13ad13c2a04f900047e229fbe6 | [
"MIT"
] | null | null | null | from argparse import Namespace, ArgumentParser
from spotty.commands.abstract_config_command import AbstractConfigCommand
from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter
from spotty.providers.abstract_instance_manager import AbstractInstanceManager
class DownloadCommand(AbstractConfigC... | 44.870968 | 117 | 0.670022 |
949d97edef568b4e8d0bd1fc05f5670af24a1168 | 1,183 | py | Python | setup.py | ivanpustogarov/manticore | f17410b8427ddbd5d751d8824bdf10ce33c9f3ce | [
"Apache-2.0"
] | null | null | null | setup.py | ivanpustogarov/manticore | f17410b8427ddbd5d751d8824bdf10ce33c9f3ce | [
"Apache-2.0"
] | null | null | null | setup.py | ivanpustogarov/manticore | f17410b8427ddbd5d751d8824bdf10ce33c9f3ce | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
on_rtd = os.environ.get('READTHEDOCS') == 'True'
def rtd_dependent_deps():
# RTD tries to build z3, ooms, and fails to build.
if on_rtd:
return []
else:
return ['z3-solver']
setup(
name='manticore',
description='Manticore is ... | 23.196078 | 106 | 0.554522 |
ce371675dd9914752d82c1d920e2697c89b2f6da | 7,770 | py | Python | api/categories.py | JinShiyin/sast_backend | b2e282d393497da1d300d83c1a045c9f78f854ea | [
"MIT"
] | null | null | null | api/categories.py | JinShiyin/sast_backend | b2e282d393497da1d300d83c1a045c9f78f854ea | [
"MIT"
] | null | null | null | api/categories.py | JinShiyin/sast_backend | b2e282d393497da1d300d83c1a045c9f78f854ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
@author: Shanda Lau 刘祥德
@license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited.
@contact: shandalaulv@gmail.com
@software:
@file: categories.py
@time: 2020/8/12 10:46
@version 1.0
@desc:
"""
import json
import os
from flask_restplus import Namespace... | 37.355769 | 112 | 0.649163 |
564c743577f0921319ab39f516afbce881cb165c | 2,273 | py | Python | application/workprogramsapp/educational_program/general_prof_competencies/models.py | oooooooooooooooosip/analytics_backend | 4006b736c2824af6308b414e32a53a77f805d4cb | [
"MIT"
] | 1 | 2021-01-24T21:25:04.000Z | 2021-01-24T21:25:04.000Z | application/workprogramsapp/educational_program/general_prof_competencies/models.py | oooooooooooooooosip/analytics_backend | 4006b736c2824af6308b414e32a53a77f805d4cb | [
"MIT"
] | 35 | 2020-06-06T01:48:56.000Z | 2022-03-09T08:59:48.000Z | application/workprogramsapp/educational_program/general_prof_competencies/models.py | oooooooooooooooosip/analytics_backend | 4006b736c2824af6308b414e32a53a77f805d4cb | [
"MIT"
] | 31 | 2020-04-26T13:12:53.000Z | 2022-03-28T13:13:35.000Z | from django.db import models
"""
Ключевые компетенции
"""
class GroupOfGeneralProfCompetencesInGeneralCharacteristic(models.Model):
"""
Группа общепрофессиональных компетенций в общей характеристике
"""
name = models.CharField(max_length=512, verbose_name="трудовая функция")
general_characterist... | 43.711538 | 128 | 0.66432 |
1f43548fe9ab2ded34f884bb5adbed20645fdf98 | 2,174 | py | Python | ambari-client/src/main/python/ambari_client/model/paths.py | flipkart-incubator/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 2 | 2015-07-29T22:50:10.000Z | 2021-11-10T16:05:59.000Z | ambari-client/src/main/python/ambari_client/model/paths.py | flipkart-incubator/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 1 | 2021-11-04T13:31:30.000Z | 2021-11-04T13:31:30.000Z | ambari-client/src/main/python/ambari_client/model/paths.py | isabella232/incubator-ambari | bf747346312170834c6beb89a60c8624b47aa288 | [
"Apache-2.0"
] | 9 | 2016-01-08T21:11:06.000Z | 2021-11-10T16:05:51.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 m... | 44.367347 | 103 | 0.770009 |
8c61368e653f5a71dcdc810024da47e3a809748d | 1,484 | py | Python | Computer Engineering/Third Year/Operating Systems/First-Come, First-Served Scheduling Non Pre-emptive/fcfs.py | jatin-eleven/Somaiya-University | a839fe9b8c60bd1e0949bc47986ba6655a23617d | [
"MIT"
] | 7 | 2020-10-01T09:33:52.000Z | 2021-10-05T13:42:16.000Z | Computer Engineering/Third Year/Operating Systems/First-Come, First-Served Scheduling Non Pre-emptive/fcfs.py | jatin-eleven/Somaiya-University | a839fe9b8c60bd1e0949bc47986ba6655a23617d | [
"MIT"
] | null | null | null | Computer Engineering/Third Year/Operating Systems/First-Come, First-Served Scheduling Non Pre-emptive/fcfs.py | jatin-eleven/Somaiya-University | a839fe9b8c60bd1e0949bc47986ba6655a23617d | [
"MIT"
] | 9 | 2020-10-01T04:40:32.000Z | 2021-10-01T19:09:59.000Z | # Implementation of First Come First Serve Algorithm for non-preemptive processes
a = []
burst_time = []
waiting_time = []
turn_around_time = []
total_waiting_time = 0
total_turnaround_time = 0
sum = 0
n = int(input("Enter the number of processes"))
for i in range (n):
a.append(input("Enter process id "))
bu... | 30.916667 | 81 | 0.607817 |
b0c83f4ab8ff0051a96db78f3729f85df6f04e9d | 3,492 | py | Python | colour/plotting/tm3018/tests/test_report.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T01:53:40.000Z | 2021-09-09T01:53:40.000Z | colour/plotting/tm3018/tests/test_report.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | null | null | null | colour/plotting/tm3018/tests/test_report.py | wenh06/colour | 445fdad2711ae39c95b4375166905568d24a95f4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.plotting.tm3018.report` module.
"""
from __future__ import division, unicode_literals
import unittest
from matplotlib.pyplot import Axes, Figure
from colour.colorimetry import SDS_ILLUMINANTS
from colour.plotting.tm3018.report import (
plot_single_s... | 31.178571 | 78 | 0.749714 |
69f3aeeb35e965a8a1d4da708567ab677d39092d | 8,062 | py | Python | code/core_nn/nn_irl.py | naivety77/SAIL | 452c63cd8b80dd29921fa166ebbc3b3943c1d3c9 | [
"MIT"
] | 8 | 2022-02-21T08:59:22.000Z | 2022-02-28T02:14:39.000Z | code/core_nn/nn_irl.py | naivety77/SAIL | 452c63cd8b80dd29921fa166ebbc3b3943c1d3c9 | [
"MIT"
] | null | null | null | code/core_nn/nn_irl.py | naivety77/SAIL | 452c63cd8b80dd29921fa166ebbc3b3943c1d3c9 | [
"MIT"
] | null | null | null | from my_utils import *
class Discriminator(nn.Module):
def __init__(self, state_dim, action_dim, num_outputs=1, hidden_size=(100, 100), activation='tanh', normalization=None, clip=0):
super().__init__()
if activation == 'tanh':
self.activation = torch.tanh
elif activation == 're... | 38.390476 | 148 | 0.601464 |
1da8d017e3a8746ee3506e04501838692cd3036c | 2,595 | py | Python | research/object_detection/utils/category_util.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | 1 | 2021-05-22T12:50:50.000Z | 2021-05-22T12:50:50.000Z | object_detection/utils/category_util.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | object_detection/utils/category_util.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | 1 | 2021-09-14T15:04:34.000Z | 2021-09-14T15:04:34.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 33.269231 | 81 | 0.660886 |
c0b07c4ca697f8b11c8267b27bf1ee56a83a1d0e | 5,177 | py | Python | mailchimp_marketing_asyncio/models/members_to_addremove_tofrom_a_static_segment.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/members_to_addremove_tofrom_a_static_segment.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/members_to_addremove_tofrom_a_static_segment.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 35.458904 | 181 | 0.639173 |
ade3db1022b6a682d41f3f488b52af369d57ab1c | 410 | py | Python | repertoire_manager/migrations/0003_auto_20180808_2336.py | vevurka/squirrel-songer | 3672aafda0842cdd787e16f61c0595992d9d6112 | [
"MIT"
] | 2 | 2018-08-31T22:50:08.000Z | 2018-09-07T23:58:41.000Z | repertoire_manager/migrations/0003_auto_20180808_2336.py | vevurka/squirrel-songer | 3672aafda0842cdd787e16f61c0595992d9d6112 | [
"MIT"
] | 9 | 2020-05-01T11:52:15.000Z | 2021-09-22T17:44:15.000Z | repertoire_manager/migrations/0003_auto_20180808_2336.py | vevurka/squirrel-songer | 3672aafda0842cdd787e16f61c0595992d9d6112 | [
"MIT"
] | 1 | 2020-05-09T19:01:54.000Z | 2020-05-09T19:01:54.000Z | # Generated by Django 2.0.7 on 2018-08-08 23:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('repertoire_manager', '0002_piecemodel_active'),
]
operations = [
migrations.AlterField(
model_name='piecemodel',
nam... | 21.578947 | 61 | 0.614634 |
c900797eed016fbcd42d4f1ae5a44612011fb85b | 8,175 | py | Python | m/expressions.py | minersoft/miner | 247ae1ffb27a4ce3203ac236afd2ed145b31a465 | [
"BSD-3-Clause"
] | 1 | 2015-04-18T16:48:48.000Z | 2015-04-18T16:48:48.000Z | m/expressions.py | minersoft/miner | 247ae1ffb27a4ce3203ac236afd2ed145b31a465 | [
"BSD-3-Clause"
] | null | null | null | m/expressions.py | minersoft/miner | 247ae1ffb27a4ce3203ac236afd2ed145b31a465 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright Michael Groys, 2012-2014
#
#
# This file implements expressions used in commands
# Two Expressions classes are available:
# Expression - general Expression which are translated as is to python expressions
# MatchExpression - uses regular expressions for match statements
#
EXP_TYPE_UNKNOWN = ""
EXP_T... | 41.497462 | 129 | 0.617615 |
be5b049a67b198ea3e5771bdb4e943a08e28db11 | 11,299 | py | Python | utilities/Gnip-Analysis-Pipeline/measurements.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | utilities/Gnip-Analysis-Pipeline/measurements.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | utilities/Gnip-Analysis-Pipeline/measurements.py | compston/TAP-Workshop | 84a7987081f71d45e057b30cc8e0cbc1b6af90d7 | [
"MIT"
] | null | null | null | import collections
import operator
import sys
# master list of class definitions
m = []
"""
This file is just a bunch of class definitions,
each of which defines a particular measurement..
All classes appended to "m" will be run on all tweets;
by calling the 'add_tweet' method. This method is defined
in Measurement... | 32.56196 | 106 | 0.650235 |
cac8ede23743334d5a75eca494e622e4663331dd | 5,793 | py | Python | OLD/NeuralNetworks.py | WenyueDai/Notes | f4108d092741cfb7446f2e88b4fc32d3bf4be648 | [
"MIT"
] | 23 | 2019-11-20T00:50:02.000Z | 2022-02-04T07:13:43.000Z | OLD/NeuralNetworks.py | WenyueDai/Notes | f4108d092741cfb7446f2e88b4fc32d3bf4be648 | [
"MIT"
] | 2 | 2020-04-25T18:52:34.000Z | 2020-07-07T18:02:35.000Z | OLD/NeuralNetworks.py | WenyueDai/Notes | f4108d092741cfb7446f2e88b4fc32d3bf4be648 | [
"MIT"
] | 44 | 2019-04-02T17:58:20.000Z | 2022-02-04T10:11:22.000Z | import numpy , pandas
from sklearn import model_selection
from sklearn import neural_network
#--------------------------------------------------
''' Representation '''
data = pandas.read_csv('sonar.csv')
X = data[data.columns[0:60]]
Y = data[data.columns[60]]
X , Y = sklearn.utils.shuffle(X , Y , random_state = 1)
X_tr... | 91.952381 | 436 | 0.690489 |
1c091033e26fb5482fe2071d70fb7898f7a7bba5 | 19,186 | py | Python | bin/scp.py | TioWang/stash | a214cbc4c8a2be2cfe44977947f02bc37068329b | [
"MIT"
] | null | null | null | bin/scp.py | TioWang/stash | a214cbc4c8a2be2cfe44977947f02bc37068329b | [
"MIT"
] | null | null | null | bin/scp.py | TioWang/stash | a214cbc4c8a2be2cfe44977947f02bc37068329b | [
"MIT"
] | 1 | 2019-01-07T09:32:22.000Z | 2019-01-07T09:32:22.000Z | """
Secure Copy - Copy files between local and remote
usage:
GET
scp [user@host:dir/file] [files/dir]
PUT
scp [file/dir] [file/dir] [user@host:dir]
"""
import argparse
# scp.py
# Copyright (C) 2008 James Bardin <j.bardin@gmail.com>
"""
Created by jbardin
https://github.com/jbardin/scp.py
Utilities f... | 33.541958 | 87 | 0.559835 |
90290676810869e480a0589424483ad09f4fbc0c | 5,575 | py | Python | src/tvl/__init__.py | ashwhall/tvl | 78fa8d2908d8eac8a032273d3142ab530cee1a33 | [
"Apache-2.0"
] | 21 | 2019-02-28T02:58:21.000Z | 2021-06-02T03:36:34.000Z | src/tvl/__init__.py | ashwhall/tvl | 78fa8d2908d8eac8a032273d3142ab530cee1a33 | [
"Apache-2.0"
] | 25 | 2019-02-22T11:39:34.000Z | 2021-06-02T00:12:26.000Z | src/tvl/__init__.py | ashwhall/tvl | 78fa8d2908d8eac8a032273d3142ab530cee1a33 | [
"Apache-2.0"
] | 6 | 2019-05-31T02:06:14.000Z | 2021-07-14T06:27:17.000Z | import importlib
import os
from contextlib import contextmanager
from threading import RLock, Condition
from typing import Dict, Sequence, Iterator, Union
import torch
import tvl.backend
from tvl.backend import BackendFactory
# Explicitly set backends for particular device types.
_device_backends: Dict[str, BackendF... | 32.04023 | 107 | 0.655426 |
f5ebae3e774ce9b3b010d4075840cd3a679001a7 | 596 | py | Python | oauth/migrations/0002_oauthuser_user.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | oauth/migrations/0002_oauthuser_user.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | oauth/migrations/0002_oauthuser_user.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-08 04:14
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('oauth', '0001_initial'),
migrations.swappable_dependency(settin... | 24.833333 | 121 | 0.666107 |
41c5b7389776ce86268585878f3a4145eca58429 | 1,723 | py | Python | vint/linting/policy/prohibit_unused_variable.py | tmsanrinsha/vint | 8c34196252b43d7361d0f58cb78cf2d3e4e4fbd0 | [
"MIT"
] | 2 | 2021-06-15T15:07:28.000Z | 2021-10-05T12:23:23.000Z | vint/linting/policy/prohibit_unused_variable.py | tmsanrinsha/vint | 8c34196252b43d7361d0f58cb78cf2d3e4e4fbd0 | [
"MIT"
] | null | null | null | vint/linting/policy/prohibit_unused_variable.py | tmsanrinsha/vint | 8c34196252b43d7361d0f58cb78cf2d3e4e4fbd0 | [
"MIT"
] | null | null | null | from vint.ast.node_type import NodeType
from vint.linting.level import Level
from vint.linting.policy.abstract_policy import AbstractPolicy
from vint.linting.policy_registry import register_policy
from vint.ast.plugin.scope_plugin import ScopeVisibility
@register_policy
class ProhibitUnusedVariable(AbstractPolicy):
... | 31.907407 | 82 | 0.684272 |
30dae15177299c887d63f2666589df5f03778960 | 1,309 | py | Python | mlpf/timing/evaluate_timing.py | edcuba/particleflow | 1c6189f499ae4807ecca42d459e363fd5b3a12ab | [
"Apache-2.0"
] | 12 | 2019-09-29T21:24:18.000Z | 2022-02-22T13:20:38.000Z | mlpf/timing/evaluate_timing.py | edcuba/particleflow | 1c6189f499ae4807ecca42d459e363fd5b3a12ab | [
"Apache-2.0"
] | 39 | 2019-10-03T18:21:01.000Z | 2021-12-07T11:58:57.000Z | mlpf/timing/evaluate_timing.py | edcuba/particleflow | 1c6189f499ae4807ecca42d459e363fd5b3a12ab | [
"Apache-2.0"
] | 19 | 2019-09-29T21:24:27.000Z | 2022-03-31T12:17:04.000Z | #!/use/bin/env python3
#on manivald: singularity exec /home/software/singularity/base.simg:latest python3 test/evaluate_timing.py
import torch
import torch_geometric
from torch_geometric.data import Data, DataLoader, DataListLoader, Batch
from graph_data import PFGraphDataset, elem_to_id, class_to_id, class_labels
... | 35.378378 | 135 | 0.71505 |
d1083873d3b35dd8541554001f5416252f389d4d | 21,978 | py | Python | py_src/lingtree/conll.py | yv/lingtree | 7356baa6792db0f88aa7b4f0ab4c2e32907741d6 | [
"MIT"
] | 1 | 2021-08-06T14:16:42.000Z | 2021-08-06T14:16:42.000Z | py_src/lingtree/conll.py | yv/lingtree | 7356baa6792db0f88aa7b4f0ab4c2e32907741d6 | [
"MIT"
] | null | null | null | py_src/lingtree/conll.py | yv/lingtree | 7356baa6792db0f88aa7b4f0ab4c2e32907741d6 | [
"MIT"
] | 1 | 2021-08-06T14:16:44.000Z | 2021-08-06T14:16:44.000Z | # Copyright 2008-2020 Yannick Versley
#
# 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, merge, publish, dist... | 35.563107 | 115 | 0.532487 |
c45f7bc5e118e5adf0ba308fa59bf4453d93c20c | 9,634 | py | Python | test/python/algorithms/test_grover.py | WiFisunset/qiskit-terra | e122c9c0cef78d1ba4ac57442cd03fb0363ba93c | [
"Apache-2.0"
] | 1 | 2021-06-09T11:22:21.000Z | 2021-06-09T11:22:21.000Z | test/python/algorithms/test_grover.py | WiFisunset/qiskit-terra | e122c9c0cef78d1ba4ac57442cd03fb0363ba93c | [
"Apache-2.0"
] | 1 | 2022-02-07T21:30:36.000Z | 2022-02-07T21:30:36.000Z | test/python/algorithms/test_grover.py | WiFisunset/qiskit-terra | e122c9c0cef78d1ba4ac57442cd03fb0363ba93c | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 38.690763 | 96 | 0.647395 |
573168c6586a7ee462ec31e6f6558fe1957f912c | 1,284 | py | Python | lib/meshrenderer/gl_utils/glfw_offscreen_context.py | AlbertoRemus/GDR_Net | 114cff27c6fc6048724a6f2bdce2306ab51d798e | [
"Apache-2.0"
] | 132 | 2021-02-25T10:45:29.000Z | 2022-03-30T06:54:26.000Z | lib/meshrenderer/gl_utils/glfw_offscreen_context.py | AlbertoRemus/GDR_Net | 114cff27c6fc6048724a6f2bdce2306ab51d798e | [
"Apache-2.0"
] | 69 | 2021-03-23T12:26:17.000Z | 2022-03-29T09:08:11.000Z | lib/meshrenderer/gl_utils/glfw_offscreen_context.py | AlbertoRemus/GDR_Net | 114cff27c6fc6048724a6f2bdce2306ab51d798e | [
"Apache-2.0"
] | 23 | 2021-03-26T06:21:32.000Z | 2022-03-23T23:53:51.000Z | # -*- coding: utf-8 -*-
import logging as log
import os
from OpenGL.GL import *
import cyglfw3 as glfw
class OffscreenContext(object):
def __init__(self):
assert glfw.Init(), "Glfw Init failed!"
glfw.WindowHint(glfw.VISIBLE, False)
self._offscreen_context = glfw.CreateWindow(1, 1, "", No... | 25.68 | 77 | 0.634735 |
03a20a6eddf794021448481d0c2406f6c1e0cdc4 | 3,054 | py | Python | src/backend/api/managers/auth_manager.py | dtenenba/motuz | 1b54295d2790f756bcb2de61f667f60b7fd5c340 | [
"MIT"
] | null | null | null | src/backend/api/managers/auth_manager.py | dtenenba/motuz | 1b54295d2790f756bcb2de61f667f60b7fd5c340 | [
"MIT"
] | null | null | null | src/backend/api/managers/auth_manager.py | dtenenba/motuz | 1b54295d2790f756bcb2de61f667f60b7fd5c340 | [
"MIT"
] | null | null | null | import logging
import datetime
from functools import wraps
import pwd
import json
from flask import request
from werkzeug.security import generate_password_hash, check_password_hash
import flask_jwt_extended as flask_jwt
from ..config import key
from ..models import InvalidToken
from ..application import db
from ..ex... | 24.829268 | 82 | 0.638507 |
2208ce6bc43497b8318a22efce3c7bdf3e285c23 | 891 | py | Python | ggplot/geoms/geom_hline.py | minrk/ggplot | c90ab65b959172c4a3488893e395dc3749dd1830 | [
"BSD-2-Clause"
] | null | null | null | ggplot/geoms/geom_hline.py | minrk/ggplot | c90ab65b959172c4a3488893e395dc3749dd1830 | [
"BSD-2-Clause"
] | null | null | null | ggplot/geoms/geom_hline.py | minrk/ggplot | c90ab65b959172c4a3488893e395dc3749dd1830 | [
"BSD-2-Clause"
] | null | null | null | import matplotlib.pyplot as plt
from copy import deepcopy
from .geom import geom
class geom_hline(geom):
VALID_AES = ['y', 'xmin', 'xmax', 'color', 'linestyle', 'alpha', 'label']
def plot_layer(self, layer):
layer = {k: v for k, v in layer.items() if k in self.VALID_AES}
layer.update(self.manua... | 28.741935 | 77 | 0.518519 |
eb2f0ba289b359395feb6fba25030dfbb20d8faa | 339 | py | Python | glue/utils/qt/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | 3 | 2015-09-10T22:23:55.000Z | 2019-04-04T18:47:33.000Z | glue/utils/qt/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | null | null | null | glue/utils/qt/__init__.py | ejeschke/glue | 21689e3474aeaeb70e258d76c60755596856976c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
from .autocomplete_widget import *
from .dialogs import *
from .colors import *
from .decorators import *
from .helpers import *
from .mixins import *
from .mime import *
from .python_list_model import *
from .threading import *
from .app import *
from .... | 24.214286 | 64 | 0.778761 |
03f1c1109d3d8648a86d20072f92dc0cb6836e44 | 1,226 | py | Python | App_Deployment/model/data_pull.py | SulmanK/Cyberpunk-2077-Twitter-Sentiment-Analysis | eccd0b0cb2ef84808a9639031ce58c41b3c62ca2 | [
"MIT"
] | 1 | 2020-10-05T01:30:22.000Z | 2020-10-05T01:30:22.000Z | App_Deployment/model/data_pull.py | SulmanK/Cyberpunk-2077-Twitter-Sentiment-Analysis | eccd0b0cb2ef84808a9639031ce58c41b3c62ca2 | [
"MIT"
] | null | null | null | App_Deployment/model/data_pull.py | SulmanK/Cyberpunk-2077-Twitter-Sentiment-Analysis | eccd0b0cb2ef84808a9639031ce58c41b3c62ca2 | [
"MIT"
] | null | null | null | #--------------------- Packages
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import numpy as np
import pandas as pd
import psycopg2
#--------------------- Data Gathering
""" Script to pull the tweets from the PostgreSQL database, retrieves the dataframe and initializes various variables ... | 35.028571 | 135 | 0.702284 |
daeca27c198f5c6dccb0736d5b46c64658e2eb70 | 1,084 | py | Python | test/3028/comments_test.py | dburkart/check-sieve | 667f0e9670e8820e37a8162ec09e794e6e4f1cb4 | [
"MIT"
] | 20 | 2015-09-06T04:16:04.000Z | 2022-03-24T16:34:56.000Z | test/3028/comments_test.py | dburkart/mail-sieve-verifier | cb51fda06c933dd1e1d0ded05ccba9bedbe67e7f | [
"MIT"
] | 24 | 2015-06-14T01:44:30.000Z | 2015-09-05T17:25:11.000Z | test/3028/comments_test.py | dburkart/mail-sieve-verifier | cb51fda06c933dd1e1d0ded05ccba9bedbe67e7f | [
"MIT"
] | 3 | 2015-09-08T05:24:08.000Z | 2019-04-01T00:15:29.000Z | import unittest
import checksieve
class TestComments(unittest.TestCase):
def test_single_line(self):
sieve = '# This is a comment'
self.assertFalse(checksieve.parse_string(sieve, False))
def test_single_line_with_code(self):
sieve = 'keep; # This is a comment'
self.ass... | 27.1 | 63 | 0.580258 |
4e283e7b6b91ad3cefa62a2d494bfca52448848c | 159 | py | Python | Codechef/Number Mirror/Number Mirror.py | Sloth-Panda/Data-Structure-and-Algorithms | 00b74ab23cb8dfc3e96cdae80de95e985ad4a110 | [
"MIT"
] | 51 | 2021-01-14T04:05:55.000Z | 2022-01-25T11:25:37.000Z | Codechef/Number Mirror/Number Mirror.py | Sloth-Panda/Data-Structure-and-Algorithms | 00b74ab23cb8dfc3e96cdae80de95e985ad4a110 | [
"MIT"
] | 638 | 2020-12-27T18:49:53.000Z | 2021-11-21T05:22:52.000Z | Codechef/Number Mirror/Number Mirror.py | Sloth-Panda/Data-Structure-and-Algorithms | 00b74ab23cb8dfc3e96cdae80de95e985ad4a110 | [
"MIT"
] | 124 | 2021-01-30T06:40:20.000Z | 2021-11-21T15:14:40.000Z | #TODO: To get an integer from user and print it
t=int(input()) #TODO: getting input from user
print(t) #TODO: displaying the same integer
| 31.8 | 56 | 0.647799 |
3064582b05f032e72f8697a62aba1a4d366c5929 | 335 | py | Python | src/data/pickle_util.py | ekand/spotipy-hits | 7ed72e4eafde7f59725645c4052f08bce4bf2c06 | [
"MIT"
] | null | null | null | src/data/pickle_util.py | ekand/spotipy-hits | 7ed72e4eafde7f59725645c4052f08bce4bf2c06 | [
"MIT"
] | null | null | null | src/data/pickle_util.py | ekand/spotipy-hits | 7ed72e4eafde7f59725645c4052f08bce4bf2c06 | [
"MIT"
] | null | null | null | import pickle
import os
def save_pickle(data, file_path):
assert not os.path.exists(file_path), "file already exists, write operation canceled"
with open(file_path, 'wb') as outfile:
pickle.dump(data, outfile)
def load_pickle(file_path):
with open(file_path, 'rb') as infile:
return pickl... | 23.928571 | 89 | 0.707463 |
0a5f06925f564c5162ff3785c72e4faf17554e2f | 741 | py | Python | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer_in_test_1/test.py | ariawahyuw/Coffee-Machine | eafb5943aebed35124bff8e7989b6129c6a5b906 | [
"Apache-2.0"
] | null | null | null | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer_in_test_1/test.py | ariawahyuw/Coffee-Machine | eafb5943aebed35124bff8e7989b6129c6a5b906 | [
"Apache-2.0"
] | 1 | 2022-02-10T13:32:31.000Z | 2022-02-10T13:32:31.000Z | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer_in_test_1/test.py | ariawahyuw/Coffee-Machine | eafb5943aebed35124bff8e7989b6129c6a5b906 | [
"Apache-2.0"
] | null | null | null | import unittest
from typing import Any, List
from hstest.check_result import CheckResult
from hstest.stage_test import StageTest
from hstest.test_case import TestCase
class WrongAnswerInTest1(StageTest):
def generate(self) -> List[TestCase]:
return [
TestCase()
]
def check(self,... | 24.7 | 62 | 0.677463 |
29ab68e9528a04c20e82ae5217dc571eb2ea7556 | 4,842 | py | Python | tests/test-addons.py | waquidvp/microk8s | eb3df26005e0f7fce24d96ca6f44aca7677b93f5 | [
"Apache-2.0"
] | null | null | null | tests/test-addons.py | waquidvp/microk8s | eb3df26005e0f7fce24d96ca6f44aca7677b93f5 | [
"Apache-2.0"
] | null | null | null | tests/test-addons.py | waquidvp/microk8s | eb3df26005e0f7fce24d96ca6f44aca7677b93f5 | [
"Apache-2.0"
] | null | null | null | import pytest
import os
import platform
from validators import (
validate_dns_dashboard,
validate_storage,
validate_ingress,
validate_gpu,
validate_istio,
validate_registry,
validate_forward,
validate_metrics_server,
validate_prometheus,
validate_fluentd,
validate_jaeger,
)
... | 30.074534 | 103 | 0.60347 |
a8348c633ae9cf5b313419d0980936fb62b9f85f | 892 | py | Python | tests/test_pyafka.py | JacekPs/pyafka | 66ddc1dfbf2439cf3d0d5f65f5e92e64877f5f50 | [
"Apache-2.0"
] | 5 | 2020-10-18T17:26:25.000Z | 2020-10-19T09:25:08.000Z | tests/test_pyafka.py | JacekPs/pyafka | 66ddc1dfbf2439cf3d0d5f65f5e92e64877f5f50 | [
"Apache-2.0"
] | null | null | null | tests/test_pyafka.py | JacekPs/pyafka | 66ddc1dfbf2439cf3d0d5f65f5e92e64877f5f50 | [
"Apache-2.0"
] | null | null | null | from pyafkalib.pyafka import kafka_consumer
from time import time, sleep
SOME_MESSAGE = 'some message'
def test_kafka_consumer(mocker):
class Message:
def value(self):
return SOME_MESSAGE
mocker.patch('confluent_kafka.DeserializingConsumer.__init__', return_value = None)
mocker.patch('... | 34.307692 | 102 | 0.724215 |
91f06af53e4719d3482a42da9c9451f36ae2b04f | 9,580 | py | Python | run_plan.py | yuandong-tian/scheduler2 | 0df0093f35c5f9e8646723a4302820a9b208038a | [
"MIT"
] | 83 | 2021-12-31T15:59:56.000Z | 2022-03-30T08:40:56.000Z | run_plan.py | yuandong-tian/scheduler2 | 0df0093f35c5f9e8646723a4302820a9b208038a | [
"MIT"
] | null | null | null | run_plan.py | yuandong-tian/scheduler2 | 0df0093f35c5f9e8646723a4302820a9b208038a | [
"MIT"
] | 8 | 2022-01-01T12:17:44.000Z | 2022-03-28T19:49:36.000Z | import os
import sys
import json
import argparse
import re
from copy import deepcopy
from enum import Enum
from datetime import datetime, timedelta, time
from collections import defaultdict
from dateutil import parser
import hashlib
gDefaultUser = os.environ["USER"]
gDefaultTag = "untagged"
class TimestampType(Enum)... | 37.131783 | 128 | 0.563361 |
e10a198f35d89d85c6d101a1192c3882a6edfff2 | 925 | py | Python | tags/migrations/0009_extra.py | adamsiwiec/tag | d77cbc9aecf9a1eaf6c57642ab9835d5faaf5e9d | [
"MIT"
] | 2 | 2017-03-01T03:22:09.000Z | 2018-02-13T04:44:24.000Z | tags/migrations/0009_extra.py | adamsiwiec/tag | d77cbc9aecf9a1eaf6c57642ab9835d5faaf5e9d | [
"MIT"
] | null | null | null | tags/migrations/0009_extra.py | adamsiwiec/tag | d77cbc9aecf9a1eaf6c57642ab9835d5faaf5e9d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-20 22:32
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependen... | 33.035714 | 118 | 0.641081 |
8af3fca261e378863233736243a67992467e3f65 | 2,558 | py | Python | crystallography/test_cases/compability.py | Huaguiyuan/crystallography | 67275599f1e132d0137ee8695bc0b49fe3de88a9 | [
"MIT"
] | null | null | null | crystallography/test_cases/compability.py | Huaguiyuan/crystallography | 67275599f1e132d0137ee8695bc0b49fe3de88a9 | [
"MIT"
] | null | null | null | crystallography/test_cases/compability.py | Huaguiyuan/crystallography | 67275599f1e132d0137ee8695bc0b49fe3de88a9 | [
"MIT"
] | 1 | 2019-12-08T01:22:29.000Z | 2019-12-08T01:22:29.000Z | from molecule import *
from structure import *
from ase.build import molecule
from pymatgen import Molecule
letters = "abcdefghijklmnopqrstuvwxyzA"
def get_ase_mol(molname):
"""convert ase molecule to pymatgen style"""
ase_mol = molecule(molname)
pos = ase_mol.get_positions()
symbols = ase_mol.get_che... | 38.179104 | 90 | 0.501955 |
75c73f61026e6057bf1505d407e88d2b8cac28bd | 3,286 | py | Python | snpEffSummary.py | tatumdmortimer/popgen-stats | eecdc4b10ea860cfd49e4fd21daa3b93b009350d | [
"MIT"
] | 45 | 2015-06-06T12:28:52.000Z | 2021-07-28T22:56:46.000Z | snpEffSummary.py | tatumdmortimer/popgen-stats | eecdc4b10ea860cfd49e4fd21daa3b93b009350d | [
"MIT"
] | 11 | 2016-08-16T20:57:40.000Z | 2020-07-07T16:37:31.000Z | snpEffSummary.py | tatumdmortimer/popgen-stats | eecdc4b10ea860cfd49e4fd21daa3b93b009350d | [
"MIT"
] | 20 | 2016-05-24T12:06:05.000Z | 2021-07-13T09:16:57.000Z | #!/usr/bin/python
import sys, os, argparse
import pandas
import vcf
from datetime import datetime
################################################################################
# This script parse output of snpEff (annotated vcf and genes file) and produces
# a summary of the synonymous and nonsynonymous variants
#... | 34.957447 | 80 | 0.580037 |
6b112de583aec94b3ffeb3f20df93d1799297e18 | 8,714 | py | Python | cmdb_extend_sdk/model/health_assessment/health_assessment_result_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | cmdb_extend_sdk/model/health_assessment/health_assessment_result_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | cmdb_extend_sdk/model/health_assessment/health_assessment_result_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: health_assessment_result.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from go... | 56.584416 | 1,050 | 0.793206 |
19bdb26b9d835f0f22a8f37599b456a3f8e1a27c | 1,128 | py | Python | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/operations_list_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | null | null | null | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/operations_list_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | null | null | null | src/sentinel/azext_sentinel/vendored_sdks/security_insights/models/operations_list_py3.py | hpsan/azure-cli-extensions | be1589bb6dd23837796e088d28e65e873050171e | [
"MIT"
] | 1 | 2020-07-16T23:49:49.000Z | 2020-07-16T23:49:49.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 32.228571 | 76 | 0.569149 |
2ffa02235395108057145e0162597968fe4f91c9 | 11,294 | py | Python | dl/dataset/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | dl/dataset/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | dl/dataset/create_goods_data.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | import logging
import math
import os
import time
import cv2
import django
import numpy as np
from dl import common
from tradition.matcher.matcher import Matcher
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
django.setup()
from goods.models import ExportAction
from django.conf import settings
impo... | 41.522059 | 152 | 0.602975 |
36b942a195d2b35d6957c2d4af1b44dcbcd0d839 | 21,552 | py | Python | setup.py | ppunktw/web3-livepeer-bot | bec63674e4d9bb07150c115fe86055981865f489 | [
"MIT"
] | 1 | 2022-02-21T21:48:09.000Z | 2022-02-21T21:48:09.000Z | setup.py | ppunktw/web3-livepeer-bot | bec63674e4d9bb07150c115fe86055981865f489 | [
"MIT"
] | 2 | 2021-10-02T02:12:24.000Z | 2022-03-17T13:13:46.000Z | setup.py | ppunktw/web3-livepeer-bot | bec63674e4d9bb07150c115fe86055981865f489 | [
"MIT"
] | 1 | 2022-02-22T18:54:24.000Z | 2022-02-22T18:54:24.000Z | import requests
# Web3
WS_MAINNET_INFURA = "wss://mainnet.infura.io/ws/v3/<INFURA-ID>"
WS_ARBITRUM_ALCHEMY = "wss://arb-mainnet.g.alchemy.com/v2/<ALCHEMY-ID>"
# Telegram
MY_TELEGRAM_ID = <CHAT-ID>
TEL_TOKEN = "<TELEGRAM-BOT-TOKEN>"
TEL_URL = "https://api.telegram.org/bot{}/".format(TEL_TOKEN)
def send_message(text, ... | 798.222222 | 16,912 | 0.689402 |
f1b81dcdec7d015fbb25e851e867a5f3acafcd67 | 272 | py | Python | URI JUDGE ONLINE/1177.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | URI JUDGE ONLINE/1177.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | URI JUDGE ONLINE/1177.py | mee-akie/Desafios-de-programacao-JAVA | 8bfdd490ea7e17599c8cd3070b5750bb5c5c38a3 | [
"MIT"
] | null | null | null | T = int(input())
T2 = T-1
L = list()
cont = 1
for i in range (0, T, +1):
L.append(T - cont)
cont = cont + 1
L2 = list()
for j in range(len(L)-1, -1, -1):
m = L[j]
L2.append(m)
L3 = L2 * 1000
for k in range(0, 1000, +1):
print(f"N[{k}] = {L3[k]}") | 13.6 | 33 | 0.477941 |
83ab5d1cd97414bdbcad5a34310a0373dd79ce1b | 5,312 | py | Python | docs/conf.py | tannewt/Adafruit_CircuitPython_TMP007 | e19423ac685c03992185d7f911a9db1e91299b5c | [
"MIT"
] | null | null | null | docs/conf.py | tannewt/Adafruit_CircuitPython_TMP007 | e19423ac685c03992185d7f911a9db1e91299b5c | [
"MIT"
] | null | null | null | docs/conf.py | tannewt/Adafruit_CircuitPython_TMP007 | e19423ac685c03992185d7f911a9db1e91299b5c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extens... | 32.993789 | 236 | 0.686747 |
321fd8df700d05739d2c9e2c88a605759308795d | 6,370 | py | Python | mergify_engine/engine/queue_runner.py | Zerdanes/mergify-engine | 36e379c8513821d1a74c355bf8be7477afbdc9c6 | [
"Apache-2.0"
] | 1 | 2021-09-09T12:52:15.000Z | 2021-09-09T12:52:15.000Z | mergify_engine/engine/queue_runner.py | Zerdanes/mergify-engine | 36e379c8513821d1a74c355bf8be7477afbdc9c6 | [
"Apache-2.0"
] | null | null | null | mergify_engine/engine/queue_runner.py | Zerdanes/mergify-engine | 36e379c8513821d1a74c355bf8be7477afbdc9c6 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | 34.247312 | 121 | 0.660283 |
94aadbc79c9bf7442ebe79a00954e1a5210b97ee | 9,019 | py | Python | network/modeling.py | SUMIN97/deeplab_pac | b32a64692c4d0411e1709b834cbc174f065dfc6a | [
"MIT"
] | null | null | null | network/modeling.py | SUMIN97/deeplab_pac | b32a64692c4d0411e1709b834cbc174f065dfc6a | [
"MIT"
] | null | null | null | network/modeling.py | SUMIN97/deeplab_pac | b32a64692c4d0411e1709b834cbc174f065dfc6a | [
"MIT"
] | null | null | null | from .utils import IntermediateLayerGetter
from ._deeplab import DeepLabHead, DeepLabHeadV3Plus, DeepLabV3, PanopticDeepLab
from .backbone import resnet
from .backbone import mobilenetv2
from .backbone import hrnetv2
def _segm_hrnet(name, backbone_name, num_classes, pretrained_backbone):
backbone = hrnetv2.__dict... | 43.360577 | 137 | 0.741657 |
1ac9e88f4f43dd613109e266d9f6dcf4c9da149d | 6,307 | py | Python | KosarajuSCC.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | KosarajuSCC.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | KosarajuSCC.py | fxie520/Coursera-Algo-Specialization | 4ae744ec2a578ac19465305077427eb0fa44a7e9 | [
"MIT"
] | null | null | null | import sys
from collections import deque
from collections import Counter
import time
sys.setrecursionlimit(10**4)
class Node:
def __init__(self, label: int):
self.label: int = label
self.neighbors: list = []
self.neighbors_reversed: list = []
self.explored: bool = False
se... | 38.932099 | 114 | 0.650547 |
1b61de65ca4bfc032487f7575520a429a91e4590 | 3,068 | py | Python | gen_kml.py | sean/delivery-routes | 482edec3499dadd2526ea2577f6962d15d62e979 | [
"MIT"
] | 6 | 2017-06-30T10:39:55.000Z | 2022-02-20T01:46:05.000Z | gen_kml.py | sean/delivery-routes | 482edec3499dadd2526ea2577f6962d15d62e979 | [
"MIT"
] | null | null | null | gen_kml.py | sean/delivery-routes | 482edec3499dadd2526ea2577f6962d15d62e979 | [
"MIT"
] | 1 | 2017-09-15T21:04:25.000Z | 2017-09-15T21:04:25.000Z | #!/usr/bin/env python
import simplekml
import argparse
import colorsys
import numpy
import simplejson
import csv
import os
from lib.config import Config
def RGBToHTMLColor(rgb_tuple):
""" convert an (R, G, B) tuple to #RRGGBB """
hexcolor = '%02x%02x%02xff' % (int(rgb_tuple[0]*256), int(rgb_tuple[1]*256), in... | 30.68 | 110 | 0.661995 |
b32598d1feec5af52b78c97d470be317b104c55b | 5,506 | py | Python | applications/init/models/db.py | himelpdas/pastebeam_web_server | 607fe5aaab571fadd99e100fdd774fc953384cf1 | [
"BSD-3-Clause"
] | null | null | null | applications/init/models/db.py | himelpdas/pastebeam_web_server | 607fe5aaab571fadd99e100fdd774fc953384cf1 | [
"BSD-3-Clause"
] | null | null | null | applications/init/models/db.py | himelpdas/pastebeam_web_server | 607fe5aaab571fadd99e100fdd774fc953384cf1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... | 44.764228 | 214 | 0.682528 |
eebef13ac637626b93137cc44557e82782fe91ea | 62,781 | py | Python | ludwig/models/model.py | Martinouj/ludwig | 48acbf6cb63a859d06eb39b2f7ec27577394251d | [
"Apache-2.0"
] | 1 | 2020-04-23T01:50:22.000Z | 2020-04-23T01:50:22.000Z | ludwig/models/model.py | Gerzer/ludwig | 71ca2189bcee7a2667c428aeb1bf738697cbe83d | [
"Apache-2.0"
] | null | null | null | ludwig/models/model.py | Gerzer/ludwig | 71ca2189bcee7a2667c428aeb1bf738697cbe83d | [
"Apache-2.0"
] | 1 | 2020-01-30T21:11:57.000Z | 2020-01-30T21:11:57.000Z | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 37.414184 | 123 | 0.547092 |
5c6c42ad5c3061f29faf71c041bb36a37bc384bb | 2,485 | py | Python | vartoml/__init__.py | manfredlotz/vartoml | 402524c74dd65bc1bf41209220fa41804752122f | [
"MIT"
] | null | null | null | vartoml/__init__.py | manfredlotz/vartoml | 402524c74dd65bc1bf41209220fa41804752122f | [
"MIT"
] | null | null | null | vartoml/__init__.py | manfredlotz/vartoml | 402524c74dd65bc1bf41209220fa41804752122f | [
"MIT"
] | null | null | null | """vartoml - Enable variables in a TOML file"""
__version__ = '0.9.2'
__author__ = 'Manfred Lotz <manfred.lotz@posteo.de>'
# __all__ = []
import toml
import os
import re
from typing import List, Dict, Match, Any, MutableMapping
"""
According to the TOML specification (https://toml.io/en/v1.0.0-rc.1)
- naming rule... | 26.157895 | 83 | 0.521529 |
a9e9864642e5eb7ae4e9a58db8dd2a93ddbe2a64 | 3,684 | py | Python | pbr-0.5.19-py2.7.egg/pbr/d2to1/tests/test_hooks.py | Rashminadig/SDN | 9945f93156ca488bcad9b95c298d7ddc90873a87 | [
"Apache-2.0"
] | null | null | null | pbr-0.5.19-py2.7.egg/pbr/d2to1/tests/test_hooks.py | Rashminadig/SDN | 9945f93156ca488bcad9b95c298d7ddc90873a87 | [
"Apache-2.0"
] | null | null | null | pbr-0.5.19-py2.7.egg/pbr/d2to1/tests/test_hooks.py | Rashminadig/SDN | 9945f93156ca488bcad9b95c298d7ddc90873a87 | [
"Apache-2.0"
] | 1 | 2019-02-04T21:41:00.000Z | 2019-02-04T21:41:00.000Z | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 applica... | 39.191489 | 95 | 0.690554 |
1679747124948cf34e303aa08f75709de63b1530 | 257 | py | Python | ncei/src/data_bundle.py | DataONEorg/d1_ncei_adapter | 34dd4ed9d581d259a70d7c9a884f520226dd2691 | [
"Apache-2.0"
] | 1 | 2019-06-19T02:41:02.000Z | 2019-06-19T02:41:02.000Z | ncei/src/data_bundle.py | DataONEorg/d1_ncei_adapter | 34dd4ed9d581d259a70d7c9a884f520226dd2691 | [
"Apache-2.0"
] | 7 | 2019-06-24T20:21:51.000Z | 2022-01-07T13:06:07.000Z | ncei/src/data_bundle.py | DataONEorg/d1_ncei_adapter | 34dd4ed9d581d259a70d7c9a884f520226dd2691 | [
"Apache-2.0"
] | 3 | 2017-04-17T13:24:20.000Z | 2019-05-28T18:32:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""":Mod: data_bundle
:Synopsis:
:Author:
servilla
:Created:
3/4/16
"""
import logging
logger = logging.getLogger('data_bundle')
def main():
return 0
if __name__ == "__main__":
main() | 9.884615 | 41 | 0.599222 |
572a6d297c3652254b0307c454346bbfeec1cd4e | 4,253 | py | Python | mod_shift/ModShiftWrapper.py | ModShift/ModShift | 13a38dd573a413e3122a35f4424c539773ee252e | [
"MIT"
] | null | null | null | mod_shift/ModShiftWrapper.py | ModShift/ModShift | 13a38dd573a413e3122a35f4424c539773ee252e | [
"MIT"
] | null | null | null | mod_shift/ModShiftWrapper.py | ModShift/ModShift | 13a38dd573a413e3122a35f4424c539773ee252e | [
"MIT"
] | 1 | 2019-11-22T08:21:46.000Z | 2019-11-22T08:21:46.000Z | import sys
import time
sys.path.append("..")
from .ModShift import ModShift
from tqdm import tqdm
import numpy as np
import os
from utils.obtain_hard_clusters import obtain_hard_clusters
from utils.metrics import compute_metrics
class ModShiftWrapper(object):
def __init__(self, config, dataset, target_dir):
... | 45.731183 | 130 | 0.531154 |
095570d04ca5a6835435d3bf1eacaa08721b7666 | 5,227 | py | Python | tests/acceptance/test_emails.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | tests/acceptance/test_emails.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_emails.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from urllib import urlencode
from sentry.testutils import AcceptanceTestCase
class EmailTestCase(AcceptanceTestCase):
def setUp(self):
super(EmailTestCase, self).setUp()
self.user = self.create_user('foo@example.com')
self.login_as(self.user)
d... | 39.598485 | 92 | 0.673044 |
cc2f15a054dc3b94d0f8f0bfe58a6cc93195bbff | 26,304 | py | Python | Form/ModiaWindow.py | mokyue/Modia-Player | 1e87c86eeea1e379025d797bbdabf744d3725b5e | [
"Unlicense"
] | null | null | null | Form/ModiaWindow.py | mokyue/Modia-Player | 1e87c86eeea1e379025d797bbdabf744d3725b5e | [
"Unlicense"
] | null | null | null | Form/ModiaWindow.py | mokyue/Modia-Player | 1e87c86eeea1e379025d797bbdabf744d3725b5e | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from PyQt4.QtCore import SIGNAL, QObject, SLOT, pyqtSlot, QRect, QPoint, QSize, Qt
from PyQt4.QtGui import QMainWindow, QPixmap, QApplication, QSizePolicy, QHBoxLayout, QVBoxLayout, QGridLayout, \
QTableWidget, QFrame, QAbstractItemView, QIcon, QPainter, QBrush, QColor, QFont
from PyQt4.... | 53.35497 | 194 | 0.642982 |
909815833c734863eff7069ad4ffdc753ba6f20b | 1,867 | py | Python | src/CrackingTheCodingInterview/src/Book/IX_InterviewQuestions/DataStructures/Ch02_LinkedLists/Python/LinkedList.py | FeodorFitsner/learning_computer-science | a18ea45b3e52057e4a07124a11f7da92d243b794 | [
"MIT"
] | 23 | 2020-11-22T07:37:07.000Z | 2022-03-23T17:23:44.000Z | src/CrackingTheCodingInterview/src/Book/IX_InterviewQuestions/DataStructures/Ch02_LinkedLists/Python/LinkedList.py | FeodorFitsner/learning_computer-science | a18ea45b3e52057e4a07124a11f7da92d243b794 | [
"MIT"
] | 40 | 2018-01-30T18:59:17.000Z | 2018-03-13T22:58:05.000Z | src/CrackingTheCodingInterview/src/Book/IX_InterviewQuestions/DataStructures/Ch02_LinkedLists/Python/LinkedList.py | FeodorFitsner/learning_computer-science | a18ea45b3e52057e4a07124a11f7da92d243b794 | [
"MIT"
] | 4 | 2020-10-19T01:14:15.000Z | 2022-03-23T20:25:36.000Z | from random import randint
class LinkedListNode:
def __init__(self, value, next_node=None, prev_node=None):
self.value = value
self.next = next_node
self.prev = prev_node
def __str__(self):
return str(self.value)
class LinkedList:
def __init__(self, values=None):
... | 24.565789 | 74 | 0.567756 |
d4327a48f107ec7913b6b51df3c828342e81a0ea | 8,277 | py | Python | src/activation_model.py | msmarsch/Thesis | 703a94fade702c3df34417a3f0c811b0b3ff5ee8 | [
"MIT"
] | null | null | null | src/activation_model.py | msmarsch/Thesis | 703a94fade702c3df34417a3f0c811b0b3ff5ee8 | [
"MIT"
] | null | null | null | src/activation_model.py | msmarsch/Thesis | 703a94fade702c3df34417a3f0c811b0b3ff5ee8 | [
"MIT"
] | null | null | null | ## Matthew Smarsch
## Cooper Union Electrical Engineering Master's Thesis
## Advisor: Professor Sam Keene
## Neural Network NNMF Implementation for the Cocktail Party Problem
import argparse
import sys, os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
import numpy as np
import datetime
import wave
imp... | 44.983696 | 224 | 0.691434 |
46ba5a28dd561cb66601da41be491fe0e65e223e | 29,152 | py | Python | libs/cryptography/x509/extensions.py | Sparklingx/nzbhydra | e2433e1155255ba37341cc79750b104e7dd8889a | [
"Apache-2.0"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | python27/win32/Lib/site-packages/cryptography/x509/extensions.py | hehahovip/oss-ftp | 400b934b2fa625e31da41b3c6af98fc14f4f63ab | [
"MIT"
] | 713 | 2015-11-06T10:48:58.000Z | 2018-11-27T16:32:18.000Z | python27/win32/Lib/site-packages/cryptography/x509/extensions.py | hehahovip/oss-ftp | 400b934b2fa625e31da41b3c6af98fc14f4f63ab | [
"MIT"
] | 106 | 2015-12-07T11:21:06.000Z | 2022-03-11T10:58:41.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import hashlib
import ipaddress
from enum import Enum
from py... | 31.515676 | 79 | 0.647537 |
299db5de964d3f590a9c2e4394e32f6380aab5c4 | 1,904 | py | Python | enrolment/tests/test_helpers.py | uktrade/directory-ui-buyer | b97f4f47a45ea67f00ca0e82ee5a5cb85fe130a3 | [
"MIT"
] | 3 | 2017-06-02T09:09:04.000Z | 2017-12-19T15:16:03.000Z | enrolment/tests/test_helpers.py | uktrade/directory-ui-buyer | b97f4f47a45ea67f00ca0e82ee5a5cb85fe130a3 | [
"MIT"
] | 257 | 2017-02-16T18:00:57.000Z | 2022-02-10T13:55:24.000Z | enrolment/tests/test_helpers.py | uktrade/directory-ui-buyer | b97f4f47a45ea67f00ca0e82ee5a5cb85fe130a3 | [
"MIT"
] | null | null | null | import http
from unittest.mock import patch
from requests import Response
import requests_mock
from enrolment import helpers
def profile_api_404(*args, **kwargs):
response = Response()
response.status_code = http.client.NOT_FOUND
return response
@patch.object(helpers.api_client.supplier, 'retrieve_pr... | 29.75 | 79 | 0.702206 |
eb4ef8f179b48ec88fc360952d57908314653e78 | 333 | py | Python | common/migrations/0016_merge_20190828_1929.py | uonafya/mfl_api | 379310b9b56cde084620f1f2dbfe4c6d7c1de47b | [
"MIT"
] | null | null | null | common/migrations/0016_merge_20190828_1929.py | uonafya/mfl_api | 379310b9b56cde084620f1f2dbfe4c6d7c1de47b | [
"MIT"
] | null | null | null | common/migrations/0016_merge_20190828_1929.py | uonafya/mfl_api | 379310b9b56cde084620f1f2dbfe4c6d7c1de47b | [
"MIT"
] | 4 | 2018-07-26T05:53:06.000Z | 2021-07-17T14:30:09.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-08-28 19:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('common', '0014_auto_20170522_2223'),
('common', '0015_apiauthentication'),
]
operatio... | 19.588235 | 46 | 0.660661 |
f422e965b0fd9240218c9eef942c1f3446adadc0 | 4,679 | py | Python | Microsoft.ML.TensorFlow.TestModels/mnist_conv_model/mnist_conv_model.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 6 | 2019-03-02T18:54:43.000Z | 2021-12-28T13:23:25.000Z | Microsoft.ML.TensorFlow.TestModels/mnist_conv_model/mnist_conv_model.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 7 | 2018-08-28T22:28:19.000Z | 2022-03-14T19:53:27.000Z | Microsoft.ML.TensorFlow.TestModels/mnist_conv_model/mnist_conv_model.py | terrajobst/machinelearning-testdata | 296625f4e49d50fcd6a48a0d92bea7584e198c0f | [
"MIT"
] | 12 | 2018-08-28T21:25:42.000Z | 2022-02-27T17:06:46.000Z | import os
import sys
import time
from datetime import datetime
import math
import pandas as pd
import numpy as np
import tensorflow as tf
def load_data(fileName):
data = pd.read_csv(fileName, header = None, sep='\t')
colnames = [ 'V'+str(x) for x in range(0, data.shape[1])]
data.columns = colnames
retu... | 38.991667 | 136 | 0.650353 |
853fdf0031390a87986e91b4568c44d204ee6783 | 1,131 | py | Python | stv/gui_helper/verify_bridge.py | blackbat13/stv | fc73fd50ad1ab6a36a6b4d6b1aec02c4bcd1b094 | [
"MIT"
] | 2 | 2021-07-11T09:52:59.000Z | 2022-02-13T17:34:59.000Z | stv/gui_helper/verify_bridge.py | blackbat13/stv | fc73fd50ad1ab6a36a6b4d6b1aec02c4bcd1b094 | [
"MIT"
] | 3 | 2020-07-26T13:49:59.000Z | 2021-01-19T18:04:10.000Z | stv/gui_helper/verify_bridge.py | blackbat13/stv | fc73fd50ad1ab6a36a6b4d6b1aec02c4bcd1b094 | [
"MIT"
] | null | null | null | import json
import sys
from stv.models import BridgeModel
n = int(sys.argv[3])
k = int(sys.argv[4])
v = int(sys.argv[5])
file_hands = open("bridge_hands.txt", "r")
json_hands = file_hands.readline()
file_hands.close()
hands = json.loads(json_hands)
bridge_model = BridgeModel(n, k, {'board': [-1, -1, -1, -1], 'left... | 26.928571 | 92 | 0.651636 |
2b27685fad0f91bff2ad4c7d1f21c88739bd3845 | 12,756 | py | Python | models/official/mask_rcnn/roi_ops.py | lionsky123/tpu | f4468c3b2e9a0214a40ac80a76a9cf5ff237d030 | [
"Apache-2.0"
] | 3 | 2019-05-30T06:01:24.000Z | 2019-10-27T14:36:49.000Z | models/official/mask_rcnn/roi_ops.py | pluieciel/tpu | 4b7c183cfca336fcc96b5a3c45cb99eda260e8df | [
"Apache-2.0"
] | null | null | null | models/official/mask_rcnn/roi_ops.py | pluieciel/tpu | 4b7c183cfca336fcc96b5a3c45cb99eda260e8df | [
"Apache-2.0"
] | 2 | 2019-07-03T20:53:03.000Z | 2021-09-18T08:18:32.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.686275 | 80 | 0.668313 |
b118c3fede539f7e271f9be54020b3b90d2de2d9 | 1,257 | py | Python | L16-multiobj-plotting.py | jdherman/eci273 | 86828b2e075258afdd528e86295170e162cc99e3 | [
"MIT"
] | 10 | 2018-12-23T02:59:06.000Z | 2021-12-07T11:55:21.000Z | L16-multiobj-plotting.py | jdherman/eci273 | 86828b2e075258afdd528e86295170e162cc99e3 | [
"MIT"
] | null | null | null | L16-multiobj-plotting.py | jdherman/eci273 | 86828b2e075258afdd528e86295170e162cc99e3 | [
"MIT"
] | 7 | 2018-12-21T02:06:51.000Z | 2021-12-11T02:36:47.000Z | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
# load a 4-objective pareto front
data = np.loadtxt('data/example-pareto-front.csv', delimiter=',')
# Example 1: N-dimensional scatter plot
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subp... | 25.653061 | 81 | 0.641209 |
f3ce0adeb1418de78ae8e7b604167b61be133b21 | 1,556 | py | Python | setup.py | jhunkeler/exyapps | 744da64b4b8897ef9354a38ea0543e908992000c | [
"MIT"
] | null | null | null | setup.py | jhunkeler/exyapps | 744da64b4b8897ef9354a38ea0543e908992000c | [
"MIT"
] | null | null | null | setup.py | jhunkeler/exyapps | 744da64b4b8897ef9354a38ea0543e908992000c | [
"MIT"
] | 1 | 2020-02-07T14:31:42.000Z | 2020-02-07T14:31:42.000Z | #!/usr/bin/env python
"""Setup script for 'exyapps'"""
from distutils.core import setup
description = "Extensions of Yet Another Python Parser System"
long_description = \
"""
EXYAPPS is an easy to use parser generator that is written in Python and
generates Python code. It is intended to be simple, very easy to u... | 32.416667 | 76 | 0.721722 |
296a79b26461f407982abc84abcb66fb7efeae8b | 868 | py | Python | tests/test_requests.py | phonosync/introApp | 74003ed3960ddf03294f5ce3f4ed5df8fb0ef90e | [
"MIT"
] | 2 | 2019-12-14T20:53:50.000Z | 2020-02-04T13:29:00.000Z | tests/test_requests.py | phonosync/introApp | 74003ed3960ddf03294f5ce3f4ed5df8fb0ef90e | [
"MIT"
] | null | null | null | tests/test_requests.py | phonosync/introApp | 74003ed3960ddf03294f5ce3f4ed5df8fb0ef90e | [
"MIT"
] | null | null | null | import os
import requests
from dotenv import load_dotenv
load_dotenv()
def test_base():
url = 'http://' + str(os.getenv('APP_HOST')) + ':' + str(os.getenv('APP_PORT'))
response = requests.get(url)
body = response.json()
assert response.status_code == 200
assert body['status'] == 'ok'
def test_t... | 25.529412 | 96 | 0.591014 |
b58d7ba5a94d78fde03adc48a9fd7da1af22f8c7 | 2,017 | py | Python | tests/api/endpoints/admin/test_license.py | weimens/seahub | 5ecf78ed7a2ddc72a23961804ee41be21c24893f | [
"Apache-2.0"
] | 420 | 2015-01-03T11:34:46.000Z | 2022-03-10T07:15:41.000Z | tests/api/endpoints/admin/test_license.py | weimens/seahub | 5ecf78ed7a2ddc72a23961804ee41be21c24893f | [
"Apache-2.0"
] | 735 | 2015-01-04T21:22:51.000Z | 2022-03-31T09:26:07.000Z | tests/api/endpoints/admin/test_license.py | weimens/seahub | 5ecf78ed7a2ddc72a23961804ee41be21c24893f | [
"Apache-2.0"
] | 379 | 2015-01-05T17:08:03.000Z | 2022-03-06T00:11:50.000Z | import os
import json
from mock import patch
from django.urls import reverse
from seahub.api2.endpoints.admin import license as license_api
from seahub.settings import LICENSE_PATH
from seahub.utils.error_msg import file_type_error_msg
from seahub.test_utils import BaseTestCase
from tests.common.utils import urljoin
... | 35.385965 | 96 | 0.671294 |
ffda72ccd5208fdbb762536828ab882ff7144355 | 305 | py | Python | models.py | 19121A05D9/project1 | 4bf68136004e84136adf49c87b3599b4a87e7085 | [
"MIT"
] | 4 | 2020-08-24T11:45:17.000Z | 2022-03-12T07:32:12.000Z | models.py | 19121A05D9/project1 | 4bf68136004e84136adf49c87b3599b4a87e7085 | [
"MIT"
] | 6 | 2021-02-18T19:34:31.000Z | 2022-01-19T14:16:22.000Z | models.py | 19121A05D9/project1 | 4bf68136004e84136adf49c87b3599b4a87e7085 | [
"MIT"
] | 5 | 2022-02-22T09:37:30.000Z | 2022-03-24T11:29:00.000Z | from flask_login import UserMixin
from . import db
class User(UserMixin, db.Model):
id = db.Column(db.Integer, primary_key=True) # primary keys are required by SQLAlchemy
email = db.Column(db.String(100), unique=True)
password = db.Column(db.String(100))
name = db.Column(db.String(1000)) | 38.125 | 90 | 0.721311 |
38737fac2f189bcb25791f223b3dd6e130a13e6a | 5,084 | py | Python | trt_yolo.py | Siraj-Qazi/tensorrt_demos | f8c602712c4b0f00e5566ed99ca05c46708a9284 | [
"MIT"
] | null | null | null | trt_yolo.py | Siraj-Qazi/tensorrt_demos | f8c602712c4b0f00e5566ed99ca05c46708a9284 | [
"MIT"
] | null | null | null | trt_yolo.py | Siraj-Qazi/tensorrt_demos | f8c602712c4b0f00e5566ed99ca05c46708a9284 | [
"MIT"
] | null | null | null | """trt_yolo.py
This script demonstrates how to do real-time object detection with
TensorRT optimized YOLO engine.
"""
import os
import time
import argparse
import cv2
import pycuda.autoinit # This is needed for initializing CUDA driver
from utils.yolo_classes import get_cls_dict
from utils.camera import add_camer... | 31.974843 | 90 | 0.636703 |
a2c110424698ae1c8fb6d1cc76c9d40897a540da | 2,406 | py | Python | tools/telemetry/telemetry/core/local_server_unittest.py | aranajhonny/chromium | caf5bcb822f79b8997720e589334266551a50a13 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-01-16T03:57:39.000Z | 2019-01-16T03:57:39.000Z | tools/telemetry/telemetry/core/local_server_unittest.py | aranajhonny/chromium | caf5bcb822f79b8997720e589334266551a50a13 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-02-10T21:00:08.000Z | 2018-03-20T05:09:50.000Z | tools/telemetry/telemetry/core/local_server_unittest.py | aranajhonny/chromium | caf5bcb822f79b8997720e589334266551a50a13 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 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.
import BaseHTTPServer
import SimpleHTTPServer
from telemetry.core import local_server
from telemetry.unittest import tab_test_case
class SimpleLocalServerBa... | 30.846154 | 73 | 0.736076 |
ab7992df21389ef0e37bff54c250eea7fd4d3ff7 | 26,701 | py | Python | straph/parser/parser.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | null | null | null | straph/parser/parser.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | null | null | null | straph/parser/parser.py | GiulioRossetti/Straph | edc021d25243bcca619c62dca1f28cf05b73a92c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017-2021 Léo Rannou - Sorbonne Université/LIP6 - Thales
#
# 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... | 37.76662 | 116 | 0.514213 |
a7d1a813715f460f072307e6616ade70a0637f8e | 3,119 | py | Python | hard/282-expression-add-operators.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | hard/282-expression-add-operators.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | hard/282-expression-add-operators.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
给表达式添加运算符
给定一个仅包含数字 0-9 的字符串和一个目标值,在数字之间添加 二元 运算符(不是一元)+、- 或 * ,返回所有能够得到目标值的表达式。
示例 1:
输入: num = "123", target = 6
输出: ["1+2+3", "1*2*3"]
示例 2:
输入: num = "232", target = 8
输出: ["2*3+2", "2+3*2"]
示例 3:
输入: num = "105", target = 5
输出: ["1*0+5","10-5"]
示例 4:
输入: num = "00", target = 0
输出: ["0+0", "0-0", "0*0"]
示... | 26.65812 | 70 | 0.422571 |
bff73787f62ae8d062f94c30fff70a26cea59a0d | 12,089 | py | Python | modules/misc.py | RotivV/Rotsong | 67b28986f2aa8ec711a4bcd831448208049daedc | [
"MIT"
] | null | null | null | modules/misc.py | RotivV/Rotsong | 67b28986f2aa8ec711a4bcd831448208049daedc | [
"MIT"
] | null | null | null | modules/misc.py | RotivV/Rotsong | 67b28986f2aa8ec711a4bcd831448208049daedc | [
"MIT"
] | 1 | 2022-01-26T22:01:20.000Z | 2022-01-26T22:01:20.000Z | import disnake
from disnake.ext import commands
import asyncio
from typing import Optional
from aiohttp import ClientSession
from utils.client import BotCore
from utils.music.converters import time_format, URL_REG
import psutil
import humanize
from itertools import cycle
from random import shuffle
from os import getpid... | 36.412651 | 192 | 0.59277 |
7159f801d7246094839eee35026d0996210a168a | 720 | py | Python | Guess_Program.py | linuxbytes/GuessNumber | 1e26280466675ecdef2a4d22b7a4a56a049631bd | [
"Unlicense"
] | null | null | null | Guess_Program.py | linuxbytes/GuessNumber | 1e26280466675ecdef2a4d22b7a4a56a049631bd | [
"Unlicense"
] | null | null | null | Guess_Program.py | linuxbytes/GuessNumber | 1e26280466675ecdef2a4d22b7a4a56a049631bd | [
"Unlicense"
] | null | null | null | import random
print('----------------------------')
print(' Guess That Number Game ')
print('----------------------------')
print()
the_number = random.randint(0, 100)
guess = -1
name = input('Player, Please your name')
while guess != the_number:
guess_test = input('Guess a number between 0 and 100: ')
... | 21.818182 | 75 | 0.579167 |
1a9d81268b04798828aa306e650d0b9028230b64 | 1,517 | py | Python | emlearn/cgen.py | bwaldt/emtrees | e3a164902a548cc0a6fa649bb2d65fcf2e594b35 | [
"MIT"
] | 41 | 2018-10-24T09:30:29.000Z | 2019-03-08T18:34:01.000Z | emlearn/cgen.py | bwaldt/emtrees | e3a164902a548cc0a6fa649bb2d65fcf2e594b35 | [
"MIT"
] | 4 | 2018-11-02T11:12:26.000Z | 2019-03-07T08:09:09.000Z | emlearn/cgen.py | bwaldt/emtrees | e3a164902a548cc0a6fa649bb2d65fcf2e594b35 | [
"MIT"
] | 3 | 2018-04-04T08:28:37.000Z | 2018-09-21T22:30:22.000Z |
"""Utilities to generate C code"""
def struct_init(*args):
"""Struct initializer
>>> from emlearn import cgen
>>> cgen.struct_init([ 1, 2, 3 ])
"{ 1, 2, 3 }"
"""
return '{ ' + ', '.join(str(a) for a in args) + ' }'
def constant(val, dtype='float'):
"""A literal value
>>> from eml... | 25.283333 | 86 | 0.567568 |
67dbac574843a18d91a2d16dd9cbf3448d71e4df | 1,633 | py | Python | python-twisted/examples/subscribe_group.py | parasyte/pubnub-python | 4a44c563ea8af7211197d166596be41ede05c179 | [
"MIT"
] | null | null | null | python-twisted/examples/subscribe_group.py | parasyte/pubnub-python | 4a44c563ea8af7211197d166596be41ede05c179 | [
"MIT"
] | null | null | null | python-twisted/examples/subscribe_group.py | parasyte/pubnub-python | 4a44c563ea8af7211197d166596be41ede05c179 | [
"MIT"
] | null | null | null | ## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from Pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo'
subscribe_key = len(sys.... | 28.649123 | 90 | 0.642376 |
a02fe67deb1bf3c9d507fc4ec86c9499bd0eaaf1 | 1,402 | py | Python | spirit/forms/comment_flag.py | Si-elegans/Web-based_GUI_Tools | 58a9b7a76bc46467554192a38ff5329a94e2b627 | [
"Apache-2.0"
] | 3 | 2017-12-01T08:17:38.000Z | 2021-01-29T15:40:06.000Z | spirit/forms/comment_flag.py | SwiftChina/Spirit | 3ab129aa062b69eb970be525c66a1e2445e29206 | [
"MIT"
] | 9 | 2020-06-05T17:44:02.000Z | 2022-01-13T00:42:34.000Z | spirit/forms/comment_flag.py | SwiftChina/Spirit | 3ab129aa062b69eb970be525c66a1e2445e29206 | [
"MIT"
] | 1 | 2020-11-08T21:47:32.000Z | 2020-11-08T21:47:32.000Z | #-*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from django.db import IntegrityError
from django.utils import timezone
from spirit.models.comment_flag import Flag, CommentFlag
class FlagForm(forms.ModelForm):
class Meta:
model = Flag
fields = [... | 30.478261 | 76 | 0.619116 |
bb1aeb7e3ba83fce29c9dc0ae9d27fb910ec61c3 | 18,146 | py | Python | cassiopeia/TreeSolver/reconstruct_sim_tree.py | Lioscro/Cassiopeia | fa630e167b3d8e6fb1c88740dff71130224ca54c | [
"MIT"
] | null | null | null | cassiopeia/TreeSolver/reconstruct_sim_tree.py | Lioscro/Cassiopeia | fa630e167b3d8e6fb1c88740dff71130224ca54c | [
"MIT"
] | null | null | null | cassiopeia/TreeSolver/reconstruct_sim_tree.py | Lioscro/Cassiopeia | fa630e167b3d8e6fb1c88740dff71130224ca54c | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
import subprocess
import time
from string import ascii_uppercase
import numpy as np
import pandas as pd
import pandascharm as pc
import random
from pylab import *
import pickle as pic
from pathlib import Path
import Bio.Phylo as Phylo
from Bio.Phy... | 28.848967 | 99 | 0.56624 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.