hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6003ed87d210b31336cb2c8da2c4371379d4efe1 | 301 | py | Python | classifier/beer/urls.py | RafaelBernardes/beer-classifier | 68edb99a231d7090d0d6d384de712b4792b3b7d0 | [
"MIT"
] | null | null | null | classifier/beer/urls.py | RafaelBernardes/beer-classifier | 68edb99a231d7090d0d6d384de712b4792b3b7d0 | [
"MIT"
] | null | null | null | classifier/beer/urls.py | RafaelBernardes/beer-classifier | 68edb99a231d7090d0d6d384de712b4792b3b7d0 | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('results', views.results, name='results'),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) | 30.1 | 67 | 0.747508 |
27f46926e35b1d825ee676bdcbb40f58b822d94c | 1,520 | py | Python | setup.py | daimon99/django-jsonp | ff19f2628522a3655b28eb15b8ad4af93a931282 | [
"MIT"
] | null | null | null | setup.py | daimon99/django-jsonp | ff19f2628522a3655b28eb15b8ad4af93a931282 | [
"MIT"
] | null | null | null | setup.py | daimon99/django-jsonp | ff19f2628522a3655b28eb15b8ad4af93a931282 | [
"MIT"
] | 1 | 2019-07-03T10:25:51.000Z | 2019-07-03T10:25:51.000Z | from distutils.core import setup
import os
import re
with open(os.path.join(os.path.dirname(__file__), 'requirements.txt')) as requirements:
install_requires = requirements.readlines()
# <https://github.com/kennethreitz/requests/blob/master/setup.py#L32>
with open('django_jsonp/__init__.py', 'r') as fd:
versi... | 41.081081 | 87 | 0.586184 |
d679f4c08386e9c543e7007fede6c2bd85d1df7a | 5,316 | py | Python | python/emr/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 2,941 | 2019-02-08T15:29:36.000Z | 2022-03-31T23:57:42.000Z | python/emr/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 558 | 2019-02-14T23:32:02.000Z | 2022-03-30T00:35:11.000Z | python/emr/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 1,409 | 2019-02-12T19:13:04.000Z | 2022-03-31T18:46:21.000Z | from aws_cdk import aws_ec2 as ec2, aws_iam as iam, core, aws_emr as emr
class EMRClusterStack(core.Stack):
def __init__(
self,
scope: core.Construct,
id: str,
s3_log_bucket: str,
s3_script_bucket: str,
spark_script: str,
**kwargs,
) -> None:
sup... | 35.918919 | 84 | 0.51693 |
09c429028e1d08b324c7e24b9969149ad16a8e96 | 1,351 | py | Python | django_project_1/users/views.py | KumarPython/Django-Projects | f69550debbd0850b4160f8b52d846c8c7e76c988 | [
"MIT"
] | null | null | null | django_project_1/users/views.py | KumarPython/Django-Projects | f69550debbd0850b4160f8b52d846c8c7e76c988 | [
"MIT"
] | null | null | null | django_project_1/users/views.py | KumarPython/Django-Projects | f69550debbd0850b4160f8b52d846c8c7e76c988 | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegistrationForm,UserUpdateForm,ProfileUpdateForm
def register(request):
if request.method=="POST":
form=UserRegistrationForm(request.POST)
... | 39.735294 | 90 | 0.695041 |
915a54c444cbbf09dbd738b2af4d4e8c2e29b268 | 14,213 | py | Python | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 45.848387 | 163 | 0.644058 |
1abb3ca84b2454d0cab286a04f5ec63f5177b8b9 | 4,058 | py | Python | src/alias/azext_alias/__init__.py | PoisonousJohn/azure-cli-extensions | cf0d7b6c031ba844dd5e43cc4e07533b85ef1269 | [
"MIT"
] | 1 | 2018-09-22T14:53:04.000Z | 2018-09-22T14:53:04.000Z | src/alias/azext_alias/__init__.py | PoisonousJohn/azure-cli-extensions | cf0d7b6c031ba844dd5e43cc4e07533b85ef1269 | [
"MIT"
] | null | null | null | src/alias/azext_alias/__init__.py | PoisonousJohn/azure-cli-extensions | cf0d7b6c031ba844dd5e43cc4e07533b85ef1269 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 40.58 | 119 | 0.684327 |
602946871925e8584690b18b46728b9d86f15e58 | 957 | py | Python | tests/test_sensor_xio_ngimu.py | LizShch/scikit-kinematics | 6819f5fff9ba686164b3e336a03c5f153da68864 | [
"BSD-3-Clause"
] | null | null | null | tests/test_sensor_xio_ngimu.py | LizShch/scikit-kinematics | 6819f5fff9ba686164b3e336a03c5f153da68864 | [
"BSD-3-Clause"
] | null | null | null | tests/test_sensor_xio_ngimu.py | LizShch/scikit-kinematics | 6819f5fff9ba686164b3e336a03c5f153da68864 | [
"BSD-3-Clause"
] | 3 | 2020-01-16T17:47:04.000Z | 2021-05-09T20:11:37.000Z | """
Test import from import data saved with NGIMU sensors from x-io,
through subclassing 'IMU_Base'
"""
# Author: Thomas Haslwanter
import numpy as np
import sys
import os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(myPath, '..', 'src','skinematics'))
import unittest
import im... | 25.864865 | 72 | 0.68652 |
2e40aad037bc41416e4506b7fc2f5c099e2e329f | 848 | py | Python | code/main.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | 169 | 2017-10-16T07:22:10.000Z | 2022-02-28T05:12:56.000Z | code/main.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | 5 | 2017-10-04T20:32:58.000Z | 2019-10-22T11:29:37.000Z | code/main.py | tchittesh/EAS- | b21acfc77f43db8abbda8f0e4029389b779a05fc | [
"MIT"
] | 41 | 2017-10-10T04:50:21.000Z | 2022-03-16T03:42:07.000Z | from expdir_monitor.expdir_monitor import ExpdirMonitor
import argparse
"""
Given a expdir, run the exp
"""
parser = argparse.ArgumentParser()
parser.add_argument(
'--test', action='store_true',
help='Test model for required dataset if pretrained model exists.'
)
parser.add_argument(
'--valid', action='store_true'... | 29.241379 | 105 | 0.728774 |
5e739e56dce2b8b46ebea82b5ea3a8359f0ee09e | 1,027 | py | Python | CrawlingServer/Vjudge.py | DirtyBat/LPOJ | bc0dc002777b0881e042abfdbb4fe2c3cc9df972 | [
"MIT"
] | 196 | 2019-01-06T08:51:09.000Z | 2022-03-31T06:51:20.000Z | CrawlingServer/Vjudge.py | lvdat/LPOJ | 4c77c683df02786fe50ca24baa00181aed09979a | [
"MIT"
] | 77 | 2019-08-06T02:04:16.000Z | 2022-02-26T09:31:08.000Z | CrawlingServer/Vjudge.py | lvdat/LPOJ | 4c77c683df02786fe50ca24baa00181aed09979a | [
"MIT"
] | 62 | 2019-06-25T08:36:55.000Z | 2022-03-16T09:49:51.000Z | import urllib.request
import urllib.parse
import json
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
def get_VJ_data(name):
try:
api_url = "https://vjudge.net/user/"+name
response = urllib.request.urlopen(api_url)
response_data=response.read()
response... | 44.652174 | 249 | 0.667965 |
e1de28a39a4172bcf73b2c7b27b8da7eec67fd40 | 3,776 | py | Python | src/main/python/widgets/dialogs/date_selection_subdialog.py | ivov/admin-stock | e2e1d53436878b6db68dcb85d0cca31223066ffb | [
"MIT"
] | 8 | 2019-11-02T22:32:30.000Z | 2021-08-16T08:29:39.000Z | src/main/python/widgets/dialogs/date_selection_subdialog.py | ivov/admin-stock | e2e1d53436878b6db68dcb85d0cca31223066ffb | [
"MIT"
] | null | null | null | src/main/python/widgets/dialogs/date_selection_subdialog.py | ivov/admin-stock | e2e1d53436878b6db68dcb85d0cca31223066ffb | [
"MIT"
] | 3 | 2019-12-10T16:23:49.000Z | 2021-11-01T20:22:16.000Z | from PyQt5 import QtWidgets, QtCore
from utils.styling import movements_dialog_date_selection_subdialog_style
from utils import db_manager
from utils import utils_collection as utils
class DateSelectionSubdialog(QtWidgets.QDialog):
def __init__(self, parent=None):
super(DateSelectionSubdialog, self).__ini... | 33.415929 | 79 | 0.634799 |
74af4c2903ce3145d6f49fd17d82ef7cbc205db1 | 1,547 | py | Python | bot/migrations/0001_initial.py | CODE-Easyy/tg-managers-bot | 24889543aa01b0cb562b232908ec7220f99a4e6c | [
"MIT"
] | null | null | null | bot/migrations/0001_initial.py | CODE-Easyy/tg-managers-bot | 24889543aa01b0cb562b232908ec7220f99a4e6c | [
"MIT"
] | null | null | null | bot/migrations/0001_initial.py | CODE-Easyy/tg-managers-bot | 24889543aa01b0cb562b232908ec7220f99a4e6c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-07 21:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 40.710526 | 121 | 0.618617 |
cf61c08324fbf6dccd47f66383d514bec5ce66ac | 82 | py | Python | DIY_NN/solutions/ff_oneline.py | PinmanHuang/CrashCourseML | b59ebf138d42fc9a1669735c6363d50938200e69 | [
"MIT"
] | 3 | 2019-02-16T05:57:09.000Z | 2019-09-16T07:07:18.000Z | DIY_NN/solutions/ff_oneline.py | PinmanHuang/CrashCourseML | b59ebf138d42fc9a1669735c6363d50938200e69 | [
"MIT"
] | null | null | null | DIY_NN/solutions/ff_oneline.py | PinmanHuang/CrashCourseML | b59ebf138d42fc9a1669735c6363d50938200e69 | [
"MIT"
] | 8 | 2019-02-14T02:51:26.000Z | 2019-10-07T07:44:24.000Z | from IPython.display import display, Latex
display(Latex("$\sigma (Cf(Ax+b)+d)$")) | 41 | 42 | 0.719512 |
15187434680d6dbca9d3d4af9861ceb4c473eeeb | 832 | py | Python | assignment_8_4.py | Rajkamalyadav707/python_for_everybody | 246b607c1c485e86f220deaa968d885ff6992e15 | [
"Apache-2.0"
] | null | null | null | assignment_8_4.py | Rajkamalyadav707/python_for_everybody | 246b607c1c485e86f220deaa968d885ff6992e15 | [
"Apache-2.0"
] | null | null | null | assignment_8_4.py | Rajkamalyadav707/python_for_everybody | 246b607c1c485e86f220deaa968d885ff6992e15 | [
"Apache-2.0"
] | null | null | null | #8.4 Open the file romeo.txt and read it line by line.
#For each line, split the line into a list of words using the split() method.
#The program should build a list of words.
#For each word on each line check to see if the word is already in the list and if not append it to the list.
#When the program completes, sort ... | 32 | 109 | 0.700721 |
ee80c80459de084bf38c8446832af9b32b8e0aee | 6,737 | py | Python | sopel/modules/admin.py | Ameenekosan/Yumiko | 16624f0b3f5c94262104b85866ce2cf7fd96f0db | [
"EFL-2.0"
] | null | null | null | sopel/modules/admin.py | Ameenekosan/Yumiko | 16624f0b3f5c94262104b85866ce2cf7fd96f0db | [
"EFL-2.0"
] | null | null | null | sopel/modules/admin.py | Ameenekosan/Yumiko | 16624f0b3f5c94262104b85866ce2cf7fd96f0db | [
"EFL-2.0"
] | null | null | null |
from __future__ import unicode_literals
from sopel.config.types import (
StaticSection, ValidatedAttribute, FilenameAttribute
)
import sopel.module
class AdminSection(StaticSection):
hold_ground = ValidatedAttribute('hold_ground', bool, default=False)
"""Auto re-join on kick"""
auto_accept_invite = ... | 30.762557 | 80 | 0.660828 |
13300ccfd0a52bc96158a7be43c6539fe28ec9c6 | 23,875 | py | Python | src/python/serif/xmlio/__init__.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | 2 | 2022-03-24T14:37:51.000Z | 2022-03-24T19:56:45.000Z | src/python/serif/xmlio/__init__.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | null | null | null | src/python/serif/xmlio/__init__.py | BBN-E/text-open | c508f6caeaa51a43cdb0bc27d8ed77e5750fdda9 | [
"Apache-2.0"
] | null | null | null | ######################################################################
# { Theory Attribute Specifications
######################################################################
from xml.etree import ElementTree as ET
def escape_cdata_carriage_return(text, encoding='utf-8'):
"""
Source copied from ElementTre... | 38.384244 | 83 | 0.624042 |
b531e3fd9488ed783a281441b42432fd3cea1ce0 | 1,960 | py | Python | nipype/interfaces/freesurfer/tests/test_auto_RobustTemplate.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/tests/test_auto_RobustTemplate.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/tests/test_auto_RobustTemplate.py | Conxz/nipype | 1281723ae56eacd103597ff4081a205583706e62 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..longitudinal import RobustTemplate
def test_RobustTemplate_inputs():
input_map = dict(args=dict(argstr='%s',
),
auto_detect_sensitivity=dict(argstr='--satit',
mandatory=True,
xor=[u'outlier_sensitivit... | 27.605634 | 78 | 0.65 |
434ce31b1dc43ffd55f4001f40f98f3fdd52738b | 6,676 | py | Python | tests/python/sync_test_app.py | shuryanc/sdk | b7ece50cfc546fa6c3620c28ee4d9aa05059678b | [
"BSD-2-Clause"
] | 1,296 | 2015-01-04T17:27:12.000Z | 2022-03-31T12:28:43.000Z | tests/python/sync_test_app.py | shuryanc/sdk | b7ece50cfc546fa6c3620c28ee4d9aa05059678b | [
"BSD-2-Clause"
] | 2,167 | 2015-01-01T14:00:45.000Z | 2022-03-08T09:40:02.000Z | tests/python/sync_test_app.py | shuryanc/sdk | b7ece50cfc546fa6c3620c28ee4d9aa05059678b | [
"BSD-2-Clause"
] | 538 | 2015-01-01T14:12:21.000Z | 2022-03-27T06:17:18.000Z | """
Application for testing syncing algorithm
(c) 2013-2014 by Mega Limited, Wellsford, New Zealand
This file is part of the MEGA SDK - Client Access Engine.
Applications using the MEGA API must present a valid application key
and comply with the the rules set forth in the Terms of Service.
The MEGA SDK is di... | 30.345455 | 130 | 0.584781 |
633ce44ed70b47e798377bbf188aaaa40f36bfae | 56,026 | py | Python | impala/hiveserver2.py | t3rmin4t0r/impyla | 0914895830609001b9d4f535573cba8db487d45e | [
"Apache-2.0"
] | null | null | null | impala/hiveserver2.py | t3rmin4t0r/impyla | 0914895830609001b9d4f535573cba8db487d45e | [
"Apache-2.0"
] | null | null | null | impala/hiveserver2.py | t3rmin4t0r/impyla | 0914895830609001b9d4f535573cba8db487d45e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cloudera Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 37.550938 | 105 | 0.6072 |
b409bdbc44fbcab668c63ba1560d1d9b02d4e573 | 3,433 | py | Python | dexter/tasks.py | CodeForAfrica/mma-dexter | 10d7f0c51bb935399c708a432699e06418049a33 | [
"Apache-2.0"
] | null | null | null | dexter/tasks.py | CodeForAfrica/mma-dexter | 10d7f0c51bb935399c708a432699e06418049a33 | [
"Apache-2.0"
] | 32 | 2019-07-25T06:17:31.000Z | 2019-08-05T02:41:42.000Z | dexter/tasks.py | CodeForAfricaLabs/mma-dexter | 10d7f0c51bb935399c708a432699e06418049a33 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import logging
from datetime import date, timedelta
from dateutil.parser import parse
from dexter.app import celery_app as app
from dexter.processing import DocumentProcessor, DocumentProcessorNT
# force configs for API keys to be set
import dexter.core
# This is a collection ... | 28.371901 | 78 | 0.635304 |
610c0fde4dbf60c131f13bf71b6057b89daf8015 | 2,205 | py | Python | tests/data/metrics/confusion_matrix/test_confusion_matrix_data_row.py | Recycleye/labelbox-python | 0a7135b10c3cdf5fb0e51d9ba15ac8c6ada648fb | [
"Apache-2.0"
] | null | null | null | tests/data/metrics/confusion_matrix/test_confusion_matrix_data_row.py | Recycleye/labelbox-python | 0a7135b10c3cdf5fb0e51d9ba15ac8c6ada648fb | [
"Apache-2.0"
] | null | null | null | tests/data/metrics/confusion_matrix/test_confusion_matrix_data_row.py | Recycleye/labelbox-python | 0a7135b10c3cdf5fb0e51d9ba15ac8c6ada648fb | [
"Apache-2.0"
] | null | null | null | from pytest_cases import fixture_ref
from pytest_cases import pytest_parametrize_plus, fixture_ref
from labelbox.data.metrics.confusion_matrix.confusion_matrix import confusion_matrix_metric
@pytest_parametrize_plus("tool_examples", [
fixture_ref('polygon_pairs'),
fixture_ref('rectangle_pairs'),
fixture_... | 38.017241 | 91 | 0.606803 |
a5356a027b7ce61dd39525a06a08aaf1266490ff | 89 | py | Python | src/ape/convert/__init__.py | benjyz/ape | b5f3ff28c97c463a764881032cb2cfcd21201d07 | [
"Apache-2.0"
] | 210 | 2021-04-29T05:42:42.000Z | 2022-03-31T15:50:17.000Z | src/ape/convert/__init__.py | benjyz/ape | b5f3ff28c97c463a764881032cb2cfcd21201d07 | [
"Apache-2.0"
] | 370 | 2021-04-29T01:54:32.000Z | 2022-03-31T19:19:29.000Z | src/ape/convert/__init__.py | benjyz/ape | b5f3ff28c97c463a764881032cb2cfcd21201d07 | [
"Apache-2.0"
] | 25 | 2021-04-29T05:08:50.000Z | 2022-03-11T20:43:56.000Z | from eth_utils import to_checksum_address as to_address
__all__ = [
"to_address",
]
| 14.833333 | 55 | 0.752809 |
3ea677dfa854e664438cc9ba559123b44399684a | 21,560 | py | Python | ufss/HLG/dipole_operator.py | peterarose/UFSS | 1dded9c94493b8d681cd8620d45d883a79e41ae3 | [
"MIT"
] | 8 | 2020-08-18T12:19:34.000Z | 2022-01-26T17:33:47.000Z | ufss/vibronic_eigenstates/dipole_operator.py | gharib85/ufss | 9aea2da19127c697e5b344548dbd8e152925b8b2 | [
"MIT"
] | 4 | 2020-09-03T11:43:44.000Z | 2022-03-25T04:13:41.000Z | ufss/vibronic_eigenstates/dipole_operator.py | gharib85/ufss | 9aea2da19127c697e5b344548dbd8e152925b8b2 | [
"MIT"
] | 2 | 2020-08-18T12:19:39.000Z | 2020-09-14T00:58:58.000Z | #Standard python libraries
import numpy as np
import os
import itertools
from scipy.sparse import csr_matrix, kron, identity
from .eigen_generator import EigenGenerator
from .eigenstates import LadderOperators
class CalculateCartesianDipoleOperatorLowMemory(EigenGenerator):
"""This class calculates the dipole ope... | 39.057971 | 131 | 0.628942 |
5d747b1dfa334f867366d19ca8dc8ee0579d132f | 632 | py | Python | support/tests/api/tests_profile/test_serializers.py | UladzislauBaranau/support-api | c453fd6ecc09027ee49d8f582c54521627ddf1a6 | [
"MIT"
] | null | null | null | support/tests/api/tests_profile/test_serializers.py | UladzislauBaranau/support-api | c453fd6ecc09027ee49d8f582c54521627ddf1a6 | [
"MIT"
] | null | null | null | support/tests/api/tests_profile/test_serializers.py | UladzislauBaranau/support-api | c453fd6ecc09027ee49d8f582c54521627ddf1a6 | [
"MIT"
] | null | null | null | from api.v1.profiles.serializers import ProfileSerializer, UpdateSupportStatusSerializer
from django.forms.models import model_to_dict
def test_profile_serializer(test_user):
serialized_data = model_to_dict(test_user)
serializer = ProfileSerializer(data=serialized_data)
assert serializer.is_valid()
... | 31.6 | 88 | 0.797468 |
9ff74c99efd0cd653c4dcaf9dc3602e01605d5d6 | 189 | py | Python | backend/database/cron/config_en.py | elexis-eu/word-game | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | null | null | null | backend/database/cron/config_en.py | elexis-eu/word-game | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | 4 | 2020-09-22T11:04:13.000Z | 2020-09-22T11:04:27.000Z | backend/database/cron/config_en.py | elexis-eu/word-games | 146aa14d5fbb2fd5e33c6021b60b09e0552c948d | [
"Apache-2.0"
] | null | null | null | class DBconfig :
host = "localhost"
port = "3306"
user = "root"
password = "root"
database = "igra_english"
class CronRoot :
path = "/home/igrabesed/database/cron/" | 21 | 43 | 0.613757 |
4ad70a4fdf0097d4887a373181cda1317dfb226f | 48 | py | Python | BAClangUtils/__init__.py | BenArvin/BAClangUtils | d1cc1836c2def6f344c36f39570ed9dc4300bf34 | [
"MIT"
] | 2 | 2019-04-18T03:58:13.000Z | 2021-01-08T09:27:46.000Z | BAClangUtils/__init__.py | BenArvin/BAClangUtils | d1cc1836c2def6f344c36f39570ed9dc4300bf34 | [
"MIT"
] | null | null | null | BAClangUtils/__init__.py | BenArvin/BAClangUtils | d1cc1836c2def6f344c36f39570ed9dc4300bf34 | [
"MIT"
] | 1 | 2019-04-18T03:58:19.000Z | 2019-04-18T03:58:19.000Z | __all__ = [
'ShellUtil',
'RawTokenUtil'] | 16 | 19 | 0.583333 |
0284f9ff42933a0963609d5590765427a1aa77dd | 106 | py | Python | US-bank-experiments-source-code/unfreeze/test.py | Namir0806/FETILDA | d4a3e720dccef3ba0221e6d59214e54a11c6fc5b | [
"MIT"
] | null | null | null | US-bank-experiments-source-code/unfreeze/test.py | Namir0806/FETILDA | d4a3e720dccef3ba0221e6d59214e54a11c6fc5b | [
"MIT"
] | null | null | null | US-bank-experiments-source-code/unfreeze/test.py | Namir0806/FETILDA | d4a3e720dccef3ba0221e6d59214e54a11c6fc5b | [
"MIT"
] | null | null | null | import sys
learning_rate = float(sys.argv[5])
print(learning_rate)
print('{:.1e}'.format(learning_rate)) | 17.666667 | 37 | 0.745283 |
ef3198a937db705e2825eb900e011ab9dac1627d | 2,034 | py | Python | tensorflow/python/keras/applications/applications_test.py | kuo1220/verbose-barnacle | 0a1b9ed01e48092f4167e366cf7496c2b111ef6d | [
"Apache-2.0"
] | 5 | 2018-10-20T03:54:49.000Z | 2021-01-02T07:19:53.000Z | tensorflow/python/keras/applications/applications_test.py | kuo1220/verbose-barnacle | 0a1b9ed01e48092f4167e366cf7496c2b111ef6d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/applications/applications_test.py | kuo1220/verbose-barnacle | 0a1b9ed01e48092f4167e366cf7496c2b111ef6d | [
"Apache-2.0"
] | 2 | 2018-11-03T01:19:26.000Z | 2021-04-23T02:34:07.000Z | # Copyright 2018 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... | 34.474576 | 80 | 0.728122 |
eb4b524e6535488d1095e43edd973cb8232ddf5e | 275 | py | Python | 0738 Hit Counter.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 1 | 2020-12-29T21:17:26.000Z | 2020-12-29T21:17:26.000Z | 0738 Hit Counter.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | null | null | null | 0738 Hit Counter.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 4 | 2021-09-09T17:42:43.000Z | 2022-03-18T04:54:03.000Z | class HitCounter:
def __init__(self):
self.queue = deque()
def add(self, timestamp):
self.queue.append(timestamp)
def count(self, timestamp):
while self.queue and self.queue[0] < timestamp-60: self.queue.popleft();return len(self.queue)
| 27.5 | 102 | 0.654545 |
1a960b364ad9fbe632edde3295ac8d04c03e60a2 | 487 | py | Python | setup.py | evandrosouza89/dods-match-stats | 4d4e9878b3fbb61b02af8ee805056aa781d03e82 | [
"MIT"
] | 3 | 2020-09-22T01:59:38.000Z | 2021-06-19T15:43:10.000Z | setup.py | evandrosouza89/dods-match-stats | 4d4e9878b3fbb61b02af8ee805056aa781d03e82 | [
"MIT"
] | null | null | null | setup.py | evandrosouza89/dods-match-stats | 4d4e9878b3fbb61b02af8ee805056aa781d03e82 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='dods_match_stats',
version='1.0',
packages=['dods_match_stats'],
url='https://github.com/evandrosouza89/dods-match-stats',
license='MIT',
author='Evandro Souza',
author_email='evandro.souza89@gmail.com',
description='A HL Log Standard parser and... | 27.055556 | 112 | 0.669405 |
10ac9a743d4578f9d646cf61cc6b91b37e6220e6 | 1,298 | py | Python | lib/storage.py | nkrios/omnibus | d73c1e720f1d97aa104a4286187f785ef0dcaae5 | [
"MIT"
] | 251 | 2018-05-08T20:40:37.000Z | 2022-03-22T22:31:17.000Z | lib/storage.py | samyoyo/omnibus | 65f6251137d6e38128c19120aa204a577b2cbcaf | [
"MIT"
] | 33 | 2018-05-08T21:30:54.000Z | 2020-08-19T16:24:28.000Z | lib/storage.py | samyoyo/omnibus | 65f6251137d6e38128c19120aa204a577b2cbcaf | [
"MIT"
] | 70 | 2018-05-16T12:53:05.000Z | 2022-03-22T22:31:20.000Z | #!/usr/bin/env python
##
# omnibus - deadbits.
# output storage management
##
import os
import json
from common import timestamp
from common import error
from common import success
from common import warning
class JSON(object):
def __init__(self, data, file_path=None, file_name='report.json', create=True):
... | 27.041667 | 83 | 0.604006 |
7828807d37dfa40a72485c174c38c84882709206 | 1,006 | py | Python | venv/Lib/site-packages/pyo/examples/06-filters/02-bandpass-filters.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | venv/Lib/site-packages/pyo/examples/06-filters/02-bandpass-filters.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | venv/Lib/site-packages/pyo/examples/06-filters/02-bandpass-filters.py | mintzer/pupillometry-rf-back | cfa86fa984a49dce0123798f8de5b838c02e10d5 | [
"CC-BY-4.0"
] | null | null | null | """
02-bandpass-filters.py - Narrowing a bandpass filter bandwidth.
This example illustrates the difference between a simple IIR second-order
bandpass filter and a cascade of second-order bandpass filters. A cascade
of four bandpass filters with a high Q can be used as a efficient resonator
on the signal.
"""
from py... | 26.473684 | 76 | 0.723658 |
3e9f5259c2f2f906e2aea8107a6244f9dffcd2bf | 8,431 | py | Python | sdk/python/pulumi_azure_native/network/v20190801/get_connection_monitor.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/get_connection_monitor.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/get_connection_monitor.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.30531 | 246 | 0.655675 |
191e602d68fac777dd789c328bebdec21b20c751 | 10,811 | py | Python | tests/px_loginhistory_test.py | noahfx/px | 1b49febda9d387f750b65a662ff662defce9acf6 | [
"MIT"
] | null | null | null | tests/px_loginhistory_test.py | noahfx/px | 1b49febda9d387f750b65a662ff662defce9acf6 | [
"MIT"
] | null | null | null | tests/px_loginhistory_test.py | noahfx/px | 1b49febda9d387f750b65a662ff662defce9acf6 | [
"MIT"
] | null | null | null | import datetime
import pytest
import dateutil.tz
from px import px_loginhistory
@pytest.yield_fixture
def check_output(capfd):
yield None
out, err = capfd.readouterr()
assert not err
assert not out
def get_users_at(last_output, now, testtime):
"""
Ask px_loginhistory to parse last_output ... | 37.023973 | 99 | 0.639441 |
ce9ddeca05ccf6da52711467ea4cd2b380f4c785 | 474 | py | Python | marketing/migrations/0005_auto_20210125_0600.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | null | null | null | marketing/migrations/0005_auto_20210125_0600.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | 9 | 2020-06-06T01:16:25.000Z | 2021-06-04T23:20:37.000Z | marketing/migrations/0005_auto_20210125_0600.py | Me2U-Afrika/Me2U | aee054afedff1e6c87f87494eaddf044e217aa95 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2021-01-25 04:00
from django.db import migrations
import stdimage.models
class Migration(migrations.Migration):
dependencies = [
('marketing', '0004_auto_20210124_0711'),
]
operations = [
migrations.AlterField(
model_name='trendinfo',
... | 23.7 | 108 | 0.647679 |
aaa85a2a0d4e7b46e1822ebb47756c903994f126 | 2,104 | py | Python | day04/solve.py | agobi/aoc-2020 | 71bf029bf95fc84147ce0ffbbe51af0d408fdead | [
"BSD-3-Clause"
] | null | null | null | day04/solve.py | agobi/aoc-2020 | 71bf029bf95fc84147ce0ffbbe51af0d408fdead | [
"BSD-3-Clause"
] | null | null | null | day04/solve.py | agobi/aoc-2020 | 71bf029bf95fc84147ce0ffbbe51af0d408fdead | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Attila Gobi
# SPDX-License-Identifier: BSD-3-Clause
"""
Solution for https://adventofcode.com/2020/day/4
>>> passports = parse("day04/test.txt")
>>> solve1(passports)
2
>>> solve2(passports)
2
"""
import sys
import re
def parse(fn):
ret = []
current = {}
with open(fn, "rt") as f:
... | 22.382979 | 68 | 0.498099 |
c6714cc558f8af867e7ffa776318b0cc1cb41c77 | 3,999 | py | Python | eval.py | zhongerqiandan/OpenDialog | f478b2a912c8c742da5ced510ac40da59217ddb3 | [
"MIT"
] | 98 | 2020-07-16T06:27:29.000Z | 2022-03-12T15:21:51.000Z | eval.py | zhongerqiandan/OpenDialog | f478b2a912c8c742da5ced510ac40da59217ddb3 | [
"MIT"
] | 2 | 2020-07-22T12:00:17.000Z | 2021-02-24T01:19:14.000Z | eval.py | gmftbyGMFTBY/OpenDialog | 8eb56b7a21cea1172131db7a56d2656364144771 | [
"MIT"
] | 19 | 2020-07-16T08:36:09.000Z | 2021-09-14T05:36:54.000Z | from header import *
from metrics import *
from utils import *
def cal_ir_metric(rest):
# P@1
p_1 = np.mean([precision_at_k(y_true, y_pred, k=1) for y_true, y_pred in rest])
# R10@1, R10@2, R10@5
recalls = [recall(y_true, y_pred, cutoffs=[1, 2, 5]) for y_true, y_pred in rest]
r10_1 = np.mean([i[0][... | 43 | 161 | 0.612153 |
d82d289aa11f6fd7a29a3ef854f2582add7748bf | 928 | py | Python | D/test_pasted_from_page.py | staguchi0703/ABC178 | 30f2a28659008d62ae18b08be8548c864530d143 | [
"MIT"
] | null | null | null | D/test_pasted_from_page.py | staguchi0703/ABC178 | 30f2a28659008d62ae18b08be8548c864530d143 | [
"MIT"
] | null | null | null | D/test_pasted_from_page.py | staguchi0703/ABC178 | 30f2a28659008d62ae18b08be8548c864530d143 | [
"MIT"
] | null | null | null | #
from resolve import resolve
####################################
####################################
# 以下にプラグインの内容をペーストする
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdou... | 23.2 | 59 | 0.53556 |
d3aa77298e312562d153b1a2d5af95658d568623 | 97 | py | Python | alternatives/server-flask/src/core/resolvers/__init__.py | TaitoUnited/full-stack-template | 58529515c2f3dd765074b4c5f326f6336646f4e7 | [
"MIT"
] | 21 | 2019-10-12T06:04:43.000Z | 2022-03-31T06:03:34.000Z | alternatives/server-flask/src/core/resolvers/__init__.py | TaitoUnited/server-template | 67f370f212adefd96da2404077e575764f6a1b11 | [
"MIT"
] | 64 | 2018-04-22T09:39:19.000Z | 2019-06-14T12:32:08.000Z | alternatives/server-flask/src/core/resolvers/__init__.py | TaitoUnited/full-stack-template | 58529515c2f3dd765074b4c5f326f6336646f4e7 | [
"MIT"
] | 4 | 2019-11-03T22:47:56.000Z | 2022-01-09T11:52:15.000Z | # GraphQL API resolvers
from . import media_resolver # noqa
from . import post_resolver # noqa
| 24.25 | 36 | 0.762887 |
0536d2d272fd292dd96cac951041f07e4e3e068e | 663 | py | Python | var/spack/repos/builtin/packages/py-webencodings/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/py-webencodings/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/py-webencodings/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # 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 PyWebencodings(PythonPackage):
"""This is a Python implementation of the WHATWG Encoding s... | 34.894737 | 95 | 0.731523 |
51c76c51621c1411470fc41191ff51e0ccb30e7b | 3,849 | py | Python | get_db_layer_data.py | erochest/problayers | a7cba057a4ede6504c461ec794d0557cdcc85281 | [
"BSD-3-Clause"
] | null | null | null | get_db_layer_data.py | erochest/problayers | a7cba057a4ede6504c461ec794d0557cdcc85281 | [
"BSD-3-Clause"
] | null | null | null | get_db_layer_data.py | erochest/problayers | a7cba057a4ede6504c461ec794d0557cdcc85281 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import fileinput
import sys
import requests
GEOSERVER = 'http://libsvr35.lib.virginia.edu:8080/geoserver/rest'
GEOSERVER_AUTH = ('slabadmin', 'GIS4slab!')
def debug(msg):
sys.stderr.write(msg + '\n')
sys.stderr.flush()
def rest_req(uri, method='get', headers=None, data=None):
... | 27.891304 | 80 | 0.551052 |
67584068db143adb81a650a04bf5f529ed4428df | 57,546 | py | Python | laygo/generators/adc_sar/adc_sar_sf_layout_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 26 | 2017-07-07T08:06:31.000Z | 2021-11-25T06:41:24.000Z | laygo/generators/adc_sar/adc_sar_sf_layout_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 9 | 2016-12-28T03:08:29.000Z | 2019-01-30T16:00:28.000Z | laygo/generators/adc_sar/adc_sar_sf_layout_generator.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 10 | 2018-07-14T01:31:28.000Z | 2021-08-21T10:18:30.000Z | #!/usr/bin/python
########################################################################################################################
#
# Copyright (c) 2014, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permi... | 75.818182 | 159 | 0.621885 |
9a71bad8ed1c7a2462aea183009fd4a930e10790 | 11,152 | py | Python | tethysapp/earth_engine/gee/methods.py | jhoanse/tethysapp-earth_engine | c3fab4b2f9ba4ab1cfe4c993a13794f9195c811f | [
"BSD-3-Clause"
] | null | null | null | tethysapp/earth_engine/gee/methods.py | jhoanse/tethysapp-earth_engine | c3fab4b2f9ba4ab1cfe4c993a13794f9195c811f | [
"BSD-3-Clause"
] | null | null | null | tethysapp/earth_engine/gee/methods.py | jhoanse/tethysapp-earth_engine | c3fab4b2f9ba4ab1cfe4c993a13794f9195c811f | [
"BSD-3-Clause"
] | null | null | null | import os
import math
import logging
import ee
from ee.ee_exception import EEException
import geojson
import pandas as pd
from . import cloud_mask as cm
from .products import EE_PRODUCTS
from ..app import EarthEngine as app
log = logging.getLogger(f'tethys.apps.{__name__}')
service_account = app.get_custom_setting('... | 33.896657 | 265 | 0.656743 |
910be802878b3dd52f8b4fc63f02170581f90d70 | 2,007 | py | Python | awx/main/migrations/_squashed_30.py | antonionovaesjr/awx | ad482708d4f6f18941afb81072ef61c5ca48446a | [
"Apache-2.0"
] | 2 | 2018-11-12T18:52:24.000Z | 2020-05-22T18:41:21.000Z | awx/main/migrations/_squashed_30.py | antonionovaesjr/awx | ad482708d4f6f18941afb81072ef61c5ca48446a | [
"Apache-2.0"
] | 3 | 2020-12-30T21:13:58.000Z | 2022-03-29T22:06:22.000Z | awx/main/migrations/_squashed_30.py | antonionovaesjr/awx | ad482708d4f6f18941afb81072ef61c5ca48446a | [
"Apache-2.0"
] | 9 | 2019-05-11T00:03:30.000Z | 2021-07-07T16:09:17.000Z | from django.db import (
migrations,
models,
)
import jsonfield.fields
import awx.main.fields
from awx.main.migrations import _save_password_keys
from awx.main.migrations import _migration_utils as migration_utils
def update_dashed_host_variables(apps, schema_editor):
Host = apps.get_model('main', 'Host')... | 32.901639 | 174 | 0.663677 |
9b3081712fff463bd4621dd633bbe9d9c9a22908 | 53 | py | Python | python/eskapade/analysis/__init__.py | mbaak/Eskapade | 00c8f6ca52eb5b738b4268257e277dab71b804cb | [
"Apache-2.0"
] | 16 | 2016-10-10T08:39:30.000Z | 2020-12-22T01:00:56.000Z | python/eskapade/analysis/__init__.py | mbaak/Eskapade | 00c8f6ca52eb5b738b4268257e277dab71b804cb | [
"Apache-2.0"
] | null | null | null | python/eskapade/analysis/__init__.py | mbaak/Eskapade | 00c8f6ca52eb5b738b4268257e277dab71b804cb | [
"Apache-2.0"
] | 6 | 2017-06-14T12:01:41.000Z | 2018-04-03T17:01:04.000Z | # flake8: noqa
from eskapade.analysis.links import *
| 17.666667 | 37 | 0.773585 |
b1593848bb279fe6795853ec17b504fa9e53c37e | 1,690 | py | Python | Cryptography/Man In Middle Attack Simulation/Bob.py | kartik2112/Interesting-Codes | 423c93b7b2b66ab46d3c188e357d1f8af31251b2 | [
"MIT"
] | null | null | null | Cryptography/Man In Middle Attack Simulation/Bob.py | kartik2112/Interesting-Codes | 423c93b7b2b66ab46d3c188e357d1f8af31251b2 | [
"MIT"
] | null | null | null | Cryptography/Man In Middle Attack Simulation/Bob.py | kartik2112/Interesting-Codes | 423c93b7b2b66ab46d3c188e357d1f8af31251b2 | [
"MIT"
] | null | null | null | import socket
import thread
import time
import sys
import subsCipher1411113 as scEnc
import random
print "\n\nHi! This is ---------- Bob's Machine -----------\n\n"
print "I am attempting to connect to Adam and receive his some spicy secret messages :-P\n\n"
prvtKey = random.randint(10,1000)
#prvtKey = 31
p,q = 231,... | 23.150685 | 93 | 0.631953 |
3bd38a5575b39d6a0f0d63ca7208ab9efab6a3ef | 3,753 | py | Python | jorldy/sync_distributed_train.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/sync_distributed_train.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | jorldy/sync_distributed_train.py | zenoengine/JORLDY | 1eb867e52a03e0282a55fa612cbc5b5de701ffe7 | [
"Apache-2.0"
] | null | null | null | import argparse
import multiprocessing as mp
from core import *
from manager import *
from process import *
# default_config_path = "config.YOUR_AGENT.YOUR_ENV"
default_config_path = "config.dqn.cartpole"
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str,... | 31.016529 | 87 | 0.596589 |
3f7948bb4c1d2aff98143cf17184026276c11073 | 1,692 | py | Python | azure/mgmt/compute/compute/v2017_03_30/models/virtual_machine_identity.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure/mgmt/compute/compute/v2017_03_30/models/virtual_machine_identity.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure/mgmt/compute/compute/v2017_03_30/models/virtual_machine_identity.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36 | 78 | 0.625296 |
a968866cdb260304020fd3637358c3567f374b69 | 547 | py | Python | migrations/versions/0305h_smtp_columns.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0305h_smtp_columns.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0305h_smtp_columns.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0305h_smtp_columns
Revises: 0305g_remove_letter_branding
Create Date: 2019-12-13 17:08:21.019759
"""
import sqlalchemy as sa
from alembic import op
revision = "0305h_smtp_columns"
down_revision = "0305g_remove_letter_branding"
def upgrade():
op.add_column("services", sa.Column("smtp_user", sa.... | 23.782609 | 87 | 0.744059 |
e5c9c055de52ac64b4cf5a896101f35d90014250 | 214 | py | Python | models/debug_unet.py | Curli-quan/fewshot-select | 34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe | [
"Apache-2.0"
] | null | null | null | models/debug_unet.py | Curli-quan/fewshot-select | 34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe | [
"Apache-2.0"
] | null | null | null | models/debug_unet.py | Curli-quan/fewshot-select | 34f8ce5069ed1fbd01c1fa73a3ef264c98dadafe | [
"Apache-2.0"
] | null | null | null | import torch
from .UNet3D import UNet3DEncoder2
import numpy as np
unet = UNet3DEncoder2(1,1,emb_len=64)
im = torch.rand((2,1,128,128,64))
feas = unet(im)
print(len(feas))
import ipdb; ipdb.set_trace()
| 19.454545 | 38 | 0.705607 |
c536802cae72817c514793a89a9b60ca50010a61 | 8,321 | py | Python | sent_selectors/modified_greedy.py | blendle/summblogcode | 93ae3f6bba8aba4557f4ccfa1b9fcc8cc8727206 | [
"0BSD"
] | 8 | 2018-04-18T20:10:36.000Z | 2019-11-19T08:33:07.000Z | sent_selectors/modified_greedy.py | blendle/summblogcode | 93ae3f6bba8aba4557f4ccfa1b9fcc8cc8727206 | [
"0BSD"
] | 2 | 2018-09-07T03:13:19.000Z | 2019-11-07T13:58:48.000Z | sent_selectors/modified_greedy.py | blendle/research-summarization | 93ae3f6bba8aba4557f4ccfa1b9fcc8cc8727206 | [
"0BSD"
] | null | null | null | import numpy as np
from sklearn.metrics import pairwise_distances
from sklearn.cluster import KMeans
import string
def modified_greedy(sentences,
tokenized,
model,
stopwords,
original_indices,
sent_representations,
... | 49.826347 | 98 | 0.585747 |
fc57aac74cef17491271e0e098cb712044677f34 | 458 | py | Python | taxdata/cps/__init__.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 12 | 2019-02-07T14:06:28.000Z | 2021-12-04T19:19:50.000Z | taxdata/cps/__init__.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 230 | 2015-10-20T18:38:10.000Z | 2018-12-05T16:04:04.000Z | taxdata/cps/__init__.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 19 | 2015-12-21T18:25:11.000Z | 2018-11-10T16:53:38.000Z | # flake8: noqa
from taxdata.cps import benefits
from taxdata.cps import cps_meta
from taxdata.cps import cpsmar
from taxdata.cps.create import create
from taxdata.cps.finalprep import finalprep
from taxdata.cps import helpers
from taxdata.cps import impute
from taxdata.cps import pycps
from taxdata.cps import splitinco... | 30.533333 | 43 | 0.842795 |
66911154aa71843c2e716af6114ea83fdbc19443 | 1,707 | py | Python | setup.py | Malachov/mylogging | df1618f7a9893fd3a6ae3912d5c7d57eebffaadb | [
"MIT"
] | null | null | null | setup.py | Malachov/mylogging | df1618f7a9893fd3a6ae3912d5c7d57eebffaadb | [
"MIT"
] | null | null | null | setup.py | Malachov/mylogging | df1618f7a9893fd3a6ae3912d5c7d57eebffaadb | [
"MIT"
] | null | null | null | #%%
from setuptools import setup, find_packages
import pkg_resources
import mylogging
version = mylogging.__version__
with open("README.md") as readme_file:
readme = readme_file.read()
with open("requirements.txt") as f:
myreqs = [str(requirement) for requirement in pkg_resources.parse_requirement... | 34.14 | 87 | 0.639719 |
94436973fed695997818295ba99b48ab10bbdde8 | 1,285 | py | Python | tests/conftest.py | jmann277/oura_cdm | de51c780d49744234757ddce2718a59abd8d8a03 | [
"MIT"
] | null | null | null | tests/conftest.py | jmann277/oura_cdm | de51c780d49744234757ddce2718a59abd8d8a03 | [
"MIT"
] | null | null | null | tests/conftest.py | jmann277/oura_cdm | de51c780d49744234757ddce2718a59abd8d8a03 | [
"MIT"
] | null | null | null | import pytest
from oura_cdm.concepts import ObservationConcept
from oura_cdm.extract_oura import get_oura_data
from oura_cdm.observation import get_observation_table
from oura_cdm.pipeline import run
from oura_cdm.concepts import Ontology
@pytest.fixture(scope='session')
def start_date():
return '2022-01-17'
@... | 21.065574 | 66 | 0.771206 |
9ea42e99df11cb036c494bb5f3f389f1b580e5c8 | 6,736 | py | Python | DPO/DataProcess/TechIndicator/TAIndicator.py | xuyuanjian/Dynamic-Portfolio-Optimization | 83c744d7914fa0965595e75797760c9eb4e87772 | [
"MIT"
] | 1 | 2021-06-15T09:31:24.000Z | 2021-06-15T09:31:24.000Z | DPO/DataProcess/TechIndicator/TAIndicator.py | dfhby0/Dynamic-Portfolio-Optimization | 6d40f6c3f9e7c27adb4ec63dc1339d717cdbc5d4 | [
"MIT"
] | 1 | 2021-06-21T10:04:09.000Z | 2021-06-21T10:04:09.000Z | DPO/DataProcess/TechIndicator/TAIndicator.py | dfhby0/Dynamic-Portfolio-Optimization | 6d40f6c3f9e7c27adb4ec63dc1339d717cdbc5d4 | [
"MIT"
] | 1 | 2021-06-15T09:31:25.000Z | 2021-06-15T09:31:25.000Z | import numpy as np
import talib
def DPOGetTATech(Open, High, Close, Low, Volume, techlist=['EMA', 'MA']):
ta_indicator = np.array([])
Open = Open.astype(float)
High = High.astype(float)
Close = Close.astype(float)
Low = Low.astype(float)
Volume = Volume.astype(float)
for tech_name in techl... | 36.410811 | 76 | 0.565024 |
b5e16dc7bd8f686e393e172fb84746f95c7c7cb2 | 3,242 | py | Python | cvtron/model_zoo/lapsrn/lapsrn.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 94 | 2018-03-31T06:32:50.000Z | 2020-09-25T10:19:23.000Z | cvtron/model_zoo/lapsrn/lapsrn.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 98 | 2018-04-02T15:55:25.000Z | 2020-04-06T09:35:36.000Z | cvtron/model_zoo/lapsrn/lapsrn.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 18 | 2018-07-10T22:54:19.000Z | 2021-03-23T05:17:39.000Z | #coding:utf-8
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import (Conv2dLayer, ElementwiseLayer, InputLayer,
PReluLayer, SubpixelConv2d)
from config import config
def lrelu(x):
return tf.maximum(x*0.2,x)
def LapSRNSingleLevel(net_im... | 45.661972 | 105 | 0.642813 |
fc01905abf8b1a891f7263df0b6f28a568564866 | 5,484 | py | Python | tests/test_cache_decorator.py | marcinkuzminski/beaker | 1cbd0ed67f8bc3b461c9571f62b303b8900666cb | [
"BSD-3-Clause"
] | 1 | 2015-04-22T02:00:38.000Z | 2015-04-22T02:00:38.000Z | tests/test_cache_decorator.py | TurboGears/beaker | 533daa6411a18e39b1072451a959deb0ecf6f97f | [
"BSD-3-Clause"
] | null | null | null | tests/test_cache_decorator.py | TurboGears/beaker | 533daa6411a18e39b1072451a959deb0ecf6f97f | [
"BSD-3-Clause"
] | null | null | null | import time
from datetime import datetime
import beaker.cache as cache
from beaker.cache import CacheManager, cache_region, region_invalidate
from beaker import util
defaults = {'cache.data_dir':'./cache', 'cache.type':'dbm', 'cache.expire': 2}
def teardown():
import shutil
shutil.rmtree('./cache', True)
@c... | 25.041096 | 78 | 0.623997 |
2824e6e97ca997c114ef7fc4d6eddf12ff1bdc76 | 5,936 | py | Python | test/continuous/test_trpo.py | mahi97/tianshou | c248b4f87e46d8fca229f29d5cabb15211c842e9 | [
"MIT"
] | null | null | null | test/continuous/test_trpo.py | mahi97/tianshou | c248b4f87e46d8fca229f29d5cabb15211c842e9 | [
"MIT"
] | null | null | null | test/continuous/test_trpo.py | mahi97/tianshou | c248b4f87e46d8fca229f29d5cabb15211c842e9 | [
"MIT"
] | null | null | null | import argparse
import os
import pprint
import gym
import numpy as np
import torch
from torch import nn
from torch.distributions import Independent, Normal
from torch.utils.tensorboard import SummaryWriter
from tianshou.data import Collector, VectorReplayBuffer
from tianshou.env import DummyVectorEnv
from tianshou.po... | 34.312139 | 84 | 0.668632 |
2b3d6c03c12e19845bb291de1232765b9bf6403b | 255 | py | Python | examples/matplotlib/mpl_plot_energy.py | sudojarvis/arviz | 73531be4f23df7d764b2e3bec8c5ef5cb882590d | [
"Apache-2.0"
] | 1,159 | 2018-04-03T08:50:54.000Z | 2022-03-31T18:03:52.000Z | examples/matplotlib/mpl_plot_energy.py | sudojarvis/arviz | 73531be4f23df7d764b2e3bec8c5ef5cb882590d | [
"Apache-2.0"
] | 1,656 | 2018-03-23T14:15:05.000Z | 2022-03-31T14:00:28.000Z | examples/matplotlib/mpl_plot_energy.py | sudojarvis/arviz | 73531be4f23df7d764b2e3bec8c5ef5cb882590d | [
"Apache-2.0"
] | 316 | 2018-04-03T14:25:52.000Z | 2022-03-25T10:41:29.000Z | """
Energy Plot
===========
_thumb: .7, .5
_example_title: Plot energy
"""
import matplotlib.pyplot as plt
import arviz as az
az.style.use("arviz-darkgrid")
data = az.load_arviz_data("centered_eight")
az.plot_energy(data, figsize=(12, 8))
plt.show()
| 14.166667 | 43 | 0.690196 |
6c0f3a17bea826be3caa38928b6fc4e603a306de | 2,640 | py | Python | pony/orm/tests/test_exists.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 2,628 | 2015-01-02T17:55:28.000Z | 2022-03-31T10:36:42.000Z | pony/orm/tests/test_exists.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 525 | 2015-01-03T20:30:08.000Z | 2022-03-23T12:30:01.000Z | pony/orm/tests/test_exists.py | ProgHaj/pony | 52720af1728ab2931364be8615e18ad8714a7c9e | [
"Apache-2.0"
] | 256 | 2015-01-02T17:55:31.000Z | 2022-03-20T17:01:37.000Z | import unittest
from pony.orm.core import *
from pony.orm.tests.testutils import *
from pony.orm.tests import setup_database, teardown_database
db = Database()
class Group(db.Entity):
students = Set('Student')
class Student(db.Entity):
first_name = Required(str)
last_name = Required(str)
login = Opt... | 33.417722 | 120 | 0.623106 |
3df10ff5fa39204ca02775869c55d236057788e8 | 594 | py | Python | NetworkApp/ip_addr_valid.py | khtran1994/Python_Networking_Applications | 3dfffa85582ee07ca9d9df05d720f65c1953a667 | [
"MIT"
] | null | null | null | NetworkApp/ip_addr_valid.py | khtran1994/Python_Networking_Applications | 3dfffa85582ee07ca9d9df05d720f65c1953a667 | [
"MIT"
] | null | null | null | NetworkApp/ip_addr_valid.py | khtran1994/Python_Networking_Applications | 3dfffa85582ee07ca9d9df05d720f65c1953a667 | [
"MIT"
] | null | null | null | import sys
#Checking octets
def ip_addr_valid(list):
for ip in list:
ip = ip.rstrip("\n")
octet_list = ip.split('.')
if (len(octet_list) == 4) and (1 <= int(octet_list[0]) <= 223) and (int(octet_list[0]) != 127) and (int(octet_list[0]) != 169 or int(octet_list[1]) != 254)... | 39.6 | 272 | 0.521886 |
077239508b35a46fb57b9a5aad6040d1c47dc3e6 | 545 | py | Python | world/exploration/migrations/0041_shardhavenobstacle_obstacle_class.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 5 | 2019-03-16T08:26:53.000Z | 2019-11-27T15:42:16.000Z | world/exploration/migrations/0041_shardhavenobstacle_obstacle_class.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 7 | 2018-09-29T05:08:15.000Z | 2021-06-10T21:35:32.000Z | world/exploration/migrations/0041_shardhavenobstacle_obstacle_class.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 7 | 2018-09-19T21:11:29.000Z | 2019-11-19T12:46:14.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-22 02:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exploration', '0040_auto_20181120_2016'),
]
operations = [
migrations.AddF... | 25.952381 | 121 | 0.640367 |
e96f53f4360a40e2b3b32e710517e8a5f2d686f9 | 739 | py | Python | newssourceaggregator/test/query_authdb.py | hayj/NewsSourceAggregator | f57803511ecb28be2f0c088d2f7d00bec4a8fe4e | [
"MIT"
] | null | null | null | newssourceaggregator/test/query_authdb.py | hayj/NewsSourceAggregator | f57803511ecb28be2f0c088d2f7d00bec4a8fe4e | [
"MIT"
] | 4 | 2021-02-08T20:25:35.000Z | 2021-12-13T19:48:38.000Z | newssourceaggregator/test/query_authdb.py | hayj/NewsSourceAggregator | f57803511ecb28be2f0c088d2f7d00bec4a8fe4e | [
"MIT"
] | null | null | null | import sys, os
sys.path.append("/".join(os.path.abspath(__file__).split("/")[0:-2]))
from sqlalchemy_declarative import User, Base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///sqlalchemy_example_auth.db')
Base.metadata.bind = engine
DBSession = session... | 26.392857 | 72 | 0.756428 |
535a9e27f210103705b60ec64ff112f7dc7c54a5 | 1,537 | py | Python | Python-Scripts/pearson_correlation.py | Peshal1067/climate-data-science | 2664d8f0fb8cad2ef353f4ec26d0a0280ac2d181 | [
"MIT"
] | 79 | 2020-02-03T22:59:53.000Z | 2022-03-09T05:50:08.000Z | Python-Scripts/pearson_correlation.py | zexuanxu/climate-data-science | 2664d8f0fb8cad2ef353f4ec26d0a0280ac2d181 | [
"MIT"
] | 1 | 2019-06-01T03:09:22.000Z | 2019-06-01T03:09:22.000Z | Python-Scripts/pearson_correlation.py | zexuanxu/climate-data-science | 2664d8f0fb8cad2ef353f4ec26d0a0280ac2d181 | [
"MIT"
] | 25 | 2020-02-27T20:37:16.000Z | 2022-01-05T21:57:31.000Z | #!/usr/bin/env python
'''
File Name: correl.py
Description: Pearson Linear Correlation for Gridded Data and Climate Indices.
Author: Willy Hagi
E-mail: hagi.willy@gmail.com
Python Version: 3.6.7
'''
import numpy as np
import xarray as xr
import proplot as plot
import matplotlib.pyplot as plt
from esmtools.sta... | 26.5 | 78 | 0.65257 |
d6a7316e93d54b3411dcb1fadc27e030f0244040 | 4,492 | py | Python | glove/glove.py | AlexisKoko/AlexisKoko | 428a514704879004667e513c6509b27be28995f9 | [
"Apache-2.0"
] | null | null | null | glove/glove.py | AlexisKoko/AlexisKoko | 428a514704879004667e513c6509b27be28995f9 | [
"Apache-2.0"
] | null | null | null | glove/glove.py | AlexisKoko/AlexisKoko | 428a514704879004667e513c6509b27be28995f9 | [
"Apache-2.0"
] | 3 | 2022-03-28T13:05:24.000Z | 2022-03-31T10:00:52.000Z | import time
import io
import sys
import numpy
import tensorflow as tf
from .normalise_text import normalise as normalise_text
# / removed from being the last param, ref https://stackoverflow.com/a/56514307
def removeprefix(self: str, prefix: str) -> str:
"""
Removes a prefix from a string.
Polyfills string.removep... | 28.794872 | 163 | 0.667409 |
c1691c5c56fadc21b2dadc7ad422e9fb6cd9a3dc | 5,602 | py | Python | run.py | BA3000/openvqa | af247b61ee4c25f64c542de73dcc3e334fa5a2c3 | [
"Apache-2.0"
] | null | null | null | run.py | BA3000/openvqa | af247b61ee4c25f64c542de73dcc3e334fa5a2c3 | [
"Apache-2.0"
] | null | null | null | run.py | BA3000/openvqa | af247b61ee4c25f64c542de73dcc3e334fa5a2c3 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# OpenVQA
# Written by Yuhao Cui https://github.com/cuiyuhao1996
# --------------------------------------------------------
from openvqa.models.model_loader import CfgLoader
from utils.exec import Execution
import argparse, yaml
def parse_args():
'''
... | 33.951515 | 81 | 0.419315 |
0d83d2a82d558c8e9126526ee9732d3b0b6bcf25 | 1,125 | py | Python | setup.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | null | null | null | setup.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | 1 | 2019-03-20T17:30:34.000Z | 2019-03-20T17:30:34.000Z | setup.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | null | null | null | import sys
from setuptools import setup
if sys.version_info < (3, 7):
requirements = ["dataclasses"]
else:
requirements = []
setup(
name="dacite",
version="0.0.24",
description="Simple creation of data classes from dictionaries.",
long_description=open("README.md").read(),
long_descriptio... | 31.25 | 96 | 0.633778 |
09e639ab8407ec6803e00fb0e08fb09e57908f63 | 7,181 | py | Python | src/demos/python/irrlicht/demo_IRR_ujoint.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 1,383 | 2015-02-04T14:17:40.000Z | 2022-03-30T04:58:16.000Z | src/demos/python/irrlicht/demo_IRR_ujoint.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 245 | 2015-01-11T15:30:51.000Z | 2022-03-30T21:28:54.000Z | src/demos/python/irrlicht/demo_IRR_ujoint.py | Benatti1991/chrono | d927a7fae8ed2f4e6695cacaef28c605fcd9ffaf | [
"BSD-3-Clause"
] | 351 | 2015-02-04T14:17:47.000Z | 2022-03-30T04:42:52.000Z | #------------------------------------------------------------------------------
# Name: pychrono example
# Purpose:
#
# Author: Lijing Yang
#
# Created: 6/10/2020
# Copyright: (c) ProjectChrono 2019
#------------------------------------------------------------------------------
import pychrono.core ... | 33.713615 | 116 | 0.678179 |
873bceb2fa848bc5d66c4dd57168acb11f17605b | 131 | py | Python | configs/gcnet/gcnet_r101-d8_512x512_160k_ade20k.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/gcnet/gcnet_r101-d8_512x512_160k_ade20k.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | configs/gcnet/gcnet_r101-d8_512x512_160k_ade20k.py | Xlinford/mmsegmentation | 8b444de5e6db2af2538a73a93ac75204f5c3bb2f | [
"Apache-2.0"
] | null | null | null | _base_ = './gcnet_r50-d8_512x512_160k_ade20k.py'
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
| 43.666667 | 80 | 0.763359 |
ce6fe2dcb0606bda51a67fd563fc8568fa4ed3de | 4,720 | py | Python | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | Metadataextraction/test_whole.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import click # used to print something
import os # used to get the location of the testdata
import extractTool # used to invoke the getMetadata function
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
# Tests to check folders
###############################
# -... | 44.952381 | 198 | 0.654661 |
e90e96aecc90c38189b66f3fdb5030c9e29a1ec8 | 7,849 | py | Python | dmi_scheduler/database.py | digitalmethodsinitiative/dmi-scheduler | 99065fef3d9bdb6ec0a84ec4499fe2300f92021b | [
"MIT"
] | 1 | 2020-08-31T11:46:27.000Z | 2020-08-31T11:46:27.000Z | dmi_scheduler/database.py | digitalmethodsinitiative/dmi-scheduler | 99065fef3d9bdb6ec0a84ec4499fe2300f92021b | [
"MIT"
] | 1 | 2021-11-03T10:44:48.000Z | 2021-11-03T11:05:45.000Z | dmi_scheduler/database.py | digitalmethodsinitiative/dmi-scheduler | 99065fef3d9bdb6ec0a84ec4499fe2300f92021b | [
"MIT"
] | null | null | null | """
Database wrapper
"""
import psycopg2.extras
import psycopg2
from psycopg2 import sql
from psycopg2.extras import execute_values
class Database:
"""
Simple database handler
Offers a number of abstraction methods that limit how much SQL one is
required to write. Also makes the database connection mostly multi... | 27.932384 | 112 | 0.70251 |
3b03d2555eb9146dca6f90881c25f87c53255921 | 5,866 | py | Python | pycspr/serialisation/deploy_from_json.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 11 | 2021-09-27T08:41:18.000Z | 2022-03-24T11:25:20.000Z | pycspr/serialisation/deploy_from_json.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 13 | 2021-09-13T19:08:45.000Z | 2022-02-08T10:01:12.000Z | pycspr/serialisation/deploy_from_json.py | casper-network/pycspr | 24244a82396db164beec23a461d13adab98aba0e | [
"Apache-2.0"
] | 14 | 2021-07-12T10:46:33.000Z | 2022-03-01T08:25:07.000Z | from pycspr.factory import create_public_key_from_account_key
from pycspr.serialisation.cl_value_from_json import decode as cl_value_from_json
from pycspr.types.deploys import Deploy
from pycspr.types.deploys import DeployApproval
from pycspr.types.deploys import DeployArgument
from pycspr.types.deploys import DeployEx... | 35.337349 | 93 | 0.724514 |
9d725af34977eca1db8a6935a5b941719cd96ae1 | 6,898 | py | Python | project/trails/add-digits.py | shivanshseth/Digit-Addition | f4b3fd936f0bc4d208fb7ea460a05afa37911379 | [
"Apache-2.0"
] | null | null | null | project/trails/add-digits.py | shivanshseth/Digit-Addition | f4b3fd936f0bc4d208fb7ea460a05afa37911379 | [
"Apache-2.0"
] | null | null | null | project/trails/add-digits.py | shivanshseth/Digit-Addition | f4b3fd936f0bc4d208fb7ea460a05afa37911379 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, Dataset
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
#loading data
X = np.load('.... | 34.49 | 128 | 0.575239 |
97c63ed1a04029e9c6b980de3265d2388c5665eb | 479 | py | Python | examples/spline_form_arc.py | mamofejo/ezdxf | bd5a08a85608360266eb8702d48638195c72c247 | [
"MIT"
] | 1 | 2021-06-05T09:15:15.000Z | 2021-06-05T09:15:15.000Z | examples/spline_form_arc.py | luoyu-123/ezdxf | 40963a2010028f87846241e08434f43ab421f3fb | [
"MIT"
] | null | null | null | examples/spline_form_arc.py | luoyu-123/ezdxf | 40963a2010028f87846241e08434f43ab421f3fb | [
"MIT"
] | null | null | null | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
from pathlib import Path
import ezdxf
DIR = Path('~/Desktop/outbox').expanduser()
doc = ezdxf.new()
msp = doc.modelspace()
arc = msp.add_arc(
center=(0, 0),
radius=1.0,
start_angle=0,
end_angle=360,
dxfattribs={'layer': 'arc'},
)
splin... | 17.740741 | 43 | 0.682672 |
bcc7b405f410fb7ff4fd705e210ff53b3c2fbe49 | 7,209 | py | Python | kubernetes/client/models/apps_v1beta1_deployment.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/apps_v1beta1_deployment.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2021-04-30T20:41:19.000Z | 2021-04-30T20:41:19.000Z | venv/lib/python2.7/site-packages/kubernetes/client/models/apps_v1beta1_deployment.py | 784134748/kubernetes-install | 5df59632c2619632e422948b667fb68eab9ff5be | [
"MIT"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 30.16318 | 281 | 0.609238 |
d853b1fd917850845d3dba12979ae0b3de168423 | 1,981 | py | Python | booldog/utils/utils.py | NIB-SI/squad-reboot | 8d32527eddc1ee04d8f0f00b8a744dbd84f811f1 | [
"MIT"
] | null | null | null | booldog/utils/utils.py | NIB-SI/squad-reboot | 8d32527eddc1ee04d8f0f00b8a744dbd84f811f1 | [
"MIT"
] | 1 | 2021-05-13T12:36:35.000Z | 2021-05-13T12:36:35.000Z | booldog/utils/utils.py | NIB-SI/BoolDoG | a638f9b2e131d2a381f6a81d6791e1436d101b9e | [
"MIT"
] | 1 | 2020-06-10T09:08:02.000Z | 2020-06-10T09:08:02.000Z | import numpy as np
def ensure_ndarray(v):
if not type(v) == np.ndarray:
return np.array([*v])
else:
return v
def parameter_to_array(parameter, graph_keys, default=1):
'''
Parameter argument to numpy array
Parameters
----------
parameter : int, float or dict
if int... | 23.034884 | 76 | 0.610803 |
8ae4daf0705ed4d198b7b16679eb5e81e6dc9d72 | 3,938 | py | Python | easyquotation/basequotation.py | fanwz/easyquotation | a829c2f2e222be3e4cb79575256f3b3ad26a0929 | [
"MIT"
] | 1 | 2020-11-09T02:19:36.000Z | 2020-11-09T02:19:36.000Z | easyquotation/basequotation.py | fanwz/easyquotation | a829c2f2e222be3e4cb79575256f3b3ad26a0929 | [
"MIT"
] | null | null | null | easyquotation/basequotation.py | fanwz/easyquotation | a829c2f2e222be3e4cb79575256f3b3ad26a0929 | [
"MIT"
] | 1 | 2019-08-02T01:02:15.000Z | 2019-08-02T01:02:15.000Z | # coding:utf8
import abc
import json
import multiprocessing.pool
import warnings
import requests
from . import helpers
class BaseQuotation(metaclass=abc.ABCMeta):
"""行情获取基类"""
max_num = 800 # 每次请求的最大股票数
@property
@abc.abstractmethod
def stock_api(self) -> str:
"""
行情 api 地址
... | 32.01626 | 78 | 0.624429 |
7e295903258435d70d120b89ce9deaf532e7a733 | 3,739 | py | Python | benchmark/startCirq1139.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1139.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1139.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=5
# total number=46
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.767677 | 77 | 0.650976 |
e72459afd6f6b83bfca461fa7242c21086fe2386 | 734 | py | Python | src/app/forms.py | lsiksous/mauviette | 06a985846b34929f22396ed16f3b4d2647025f21 | [
"FTL"
] | null | null | null | src/app/forms.py | lsiksous/mauviette | 06a985846b34929f22396ed16f3b4d2647025f21 | [
"FTL"
] | null | null | null | src/app/forms.py | lsiksous/mauviette | 06a985846b34929f22396ed16f3b4d2647025f21 | [
"FTL"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import (
SubmitField,
SelectField,
TextAreaField,
StringField,
BooleanField,
PasswordField,
)
from wtforms.validators import DataRequired, Length
class LoginForm(FlaskForm):
username = StringField("Username", validators=[DataRequired()])
pas... | 27.185185 | 86 | 0.689373 |
33cfbddcab6c846b8f0f01935d44df05fa41b7ed | 869 | py | Python | pack.py | TonyBCooper/PinningCalc | 1733613f5f9c3186a09a0666b94cc5c497d18749 | [
"MIT"
] | null | null | null | pack.py | TonyBCooper/PinningCalc | 1733613f5f9c3186a09a0666b94cc5c497d18749 | [
"MIT"
] | null | null | null | pack.py | TonyBCooper/PinningCalc | 1733613f5f9c3186a09a0666b94cc5c497d18749 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Tony Cooper
Created On: 2021-01-05
"""
import os
import py_compile
import shutil
import zipapp
sourceFiles = ['data', 'FrmAbout', 'FrmMain', 'SysBase', 'SysCorbinRusswinSystem70IC', 'UIBase']
copyFiles = ['__main__.py','app.icns', 'app.ico', 'app.png', 'app.g... | 26.333333 | 96 | 0.713464 |
c2c2a5c89d76781334900e3b8ab1e49941b3de88 | 9,347 | py | Python | src/models/CORAL_BART/metrics.py | behavioral-data/multiverse | 82b7265de0aa3e9d229ce9f3f86b8b48435ca365 | [
"MIT"
] | null | null | null | src/models/CORAL_BART/metrics.py | behavioral-data/multiverse | 82b7265de0aa3e9d229ce9f3f86b8b48435ca365 | [
"MIT"
] | null | null | null | src/models/CORAL_BART/metrics.py | behavioral-data/multiverse | 82b7265de0aa3e9d229ce9f3f86b8b48435ca365 | [
"MIT"
] | 1 | 2021-08-19T15:21:50.000Z | 2021-08-19T15:21:50.000Z | from transformers import EvalPrediction
from rouge import Rouge
import numpy as np
from scipy.special import softmax
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score
from nltk.translate.gleu_score import corpus_gleu
from functools import partial
from typing import Na... | 36.228682 | 111 | 0.659677 |
d3b0d865e2fabe210680dc99007df8f623b06ea9 | 692 | py | Python | src/main/forms.py | itmo-wad/Task6_Tatarov_Dmitriy | 29f4caf9717c6ce9dc322fadcf77cfb3162720d1 | [
"Apache-2.0"
] | null | null | null | src/main/forms.py | itmo-wad/Task6_Tatarov_Dmitriy | 29f4caf9717c6ce9dc322fadcf77cfb3162720d1 | [
"Apache-2.0"
] | null | null | null | src/main/forms.py | itmo-wad/Task6_Tatarov_Dmitriy | 29f4caf9717c6ce9dc322fadcf77cfb3162720d1 | [
"Apache-2.0"
] | null | null | null | from flask_wtf import Form
from wtforms import TextField, TextAreaField, SubmitField, PasswordField, BooleanField
from wtforms.validators import DataRequired
class SignUpForm(Form):
username = TextField('User Name', validators= [ DataRequired()])
password = PasswordField('Password',validators=[ DataRequired()]... | 38.444444 | 86 | 0.736994 |
fde476069169ad0861f488e03a7a59d5ca0f9423 | 1,079 | py | Python | or.py | shivendrd/OneNeuron | 43fdcaa4ebea44bbf4f65edce0e58cf838db1a8a | [
"MIT"
] | null | null | null | or.py | shivendrd/OneNeuron | 43fdcaa4ebea44bbf4f65edce0e58cf838db1a8a | [
"MIT"
] | null | null | null | or.py | shivendrd/OneNeuron | 43fdcaa4ebea44bbf4f65edce0e58cf838db1a8a | [
"MIT"
] | null | null | null | from utils.model import Perceptron
from utils.all_utils import prepare_data,save_plot, save_model
import numpy as np
import pandas as pd
def main(data, eta, epochs, plotFilename, filename):
"""it will give the data send the data to dataframe create a plot creating a model
Args:
data ([pd.DataFrame]... | 24.522727 | 87 | 0.620019 |
99d67518b42bd84b66f4b24dd98e24be62a8fc78 | 374 | py | Python | Atividade-1/questao-4.py | David-Marcoss/POO1-PYTHON | b0a49fb95e8b87fdfe2fc40eca547bf25f93c3c4 | [
"MIT"
] | null | null | null | Atividade-1/questao-4.py | David-Marcoss/POO1-PYTHON | b0a49fb95e8b87fdfe2fc40eca547bf25f93c3c4 | [
"MIT"
] | null | null | null | Atividade-1/questao-4.py | David-Marcoss/POO1-PYTHON | b0a49fb95e8b87fdfe2fc40eca547bf25f93c3c4 | [
"MIT"
] | null | null | null | def fatorial(n):
fat =1
for i in range(2,n+1):
fat*= i
return fat
def fatorial2(n):
if n == 0:
return 0
if n == 1:
return 1
if n > 1:
return fatorial2(n - 1) * n
n = int(input('digite um valor: '))
print('fatorial iterativo {} = {}'.format(n,fatorial(n)))
prin... | 19.684211 | 58 | 0.532086 |
b62647b20f0c225308435084d96a965463cf313d | 2,154 | py | Python | sentinelhub/sentinelhub_session.py | AbnerErnaniADSFatec/sentinelhub-py | a27204e666368e29796be947e9d7cfd2b4a2f1ac | [
"MIT"
] | 1 | 2020-06-23T21:52:56.000Z | 2020-06-23T21:52:56.000Z | sentinelhub/sentinelhub_session.py | AbnerErnaniADSFatec/sentinelhub-py | a27204e666368e29796be947e9d7cfd2b4a2f1ac | [
"MIT"
] | null | null | null | sentinelhub/sentinelhub_session.py | AbnerErnaniADSFatec/sentinelhub-py | a27204e666368e29796be947e9d7cfd2b4a2f1ac | [
"MIT"
] | null | null | null | """
Module implementing Sentinel Hub session object
"""
import time
from oauthlib.oauth2 import BackendApplicationClient
from requests_oauthlib import OAuth2Session
from .config import SHConfig
class SentinelHubSession:
""" Sentinel Hub authentication class
The class will do OAuth2 authentication with Sent... | 31.676471 | 117 | 0.654596 |
453334f68683cccdb4b15b0ff25c1a314e1261c2 | 89 | py | Python | tccli/services/bmvpc/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 47 | 2018-05-31T11:26:25.000Z | 2022-03-08T02:12:45.000Z | tccli/services/bmvpc/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 23 | 2018-06-14T10:46:30.000Z | 2022-02-28T02:53:09.000Z | tccli/services/bmvpc/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 22 | 2018-10-22T09:49:45.000Z | 2022-03-30T08:06:04.000Z | # -*- coding: utf-8 -*-
from tccli.services.bmvpc.bmvpc_client import action_caller
| 22.25 | 59 | 0.707865 |
5064034c350c527f4325d63f3db516c3125a1089 | 2,460 | py | Python | examples/legacy/plugins/workbench/AcmeLabUsingEggs/src/acme.workbench/acme/workbench/view/color_view.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 51 | 2015-05-12T01:34:15.000Z | 2022-03-20T19:11:22.000Z | examples/legacy/plugins/workbench/AcmeLabUsingEggs/src/acme.workbench/acme/workbench/view/color_view.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 347 | 2015-02-27T19:51:09.000Z | 2022-03-21T16:03:01.000Z | examples/legacy/plugins/workbench/AcmeLabUsingEggs/src/acme.workbench/acme/workbench/view/color_view.py | enthought/envisage | ca57225c4e9022d1ed5299a60e13dc2290d7d94e | [
"BSD-3-Clause"
] | 11 | 2015-02-11T04:32:54.000Z | 2021-09-13T10:50:05.000Z | """ A view containing a colored panel! """
# Enthought library imports.
from traits.etsconfig.api import ETSConfig
from pyface.workbench.api import View
class ColorView(View):
""" A view containing a colored panel!
This view is written so that it works with *both* wx and Qt4. Your own
views obviously d... | 30.37037 | 79 | 0.513821 |
b42a41648d58a9d3cfcf6299a9275c63a2e23151 | 127 | py | Python | tests/test_world.py | thorium-cloud/boto3-assistant | 480551afbb28b5348aa54e6dee987f2448544e33 | [
"MIT"
] | null | null | null | tests/test_world.py | thorium-cloud/boto3-assistant | 480551afbb28b5348aa54e6dee987f2448544e33 | [
"MIT"
] | null | null | null | tests/test_world.py | thorium-cloud/boto3-assistant | 480551afbb28b5348aa54e6dee987f2448544e33 | [
"MIT"
] | null | null | null | from boto3_assistant import world
def test_world():
response = world.invoke({}, {})
assert response == "Hello World"
| 18.142857 | 36 | 0.677165 |
f9e78bc8f47e6c8d9898a977540f50e0fe9a2b3c | 967 | py | Python | src/kol/request/DeclineTradeResponseRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-02-16T08:30:49.000Z | 2020-05-01T06:06:33.000Z | src/kol/request/DeclineTradeResponseRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 5 | 2015-01-13T23:01:54.000Z | 2016-11-30T15:23:43.000Z | src/kol/request/DeclineTradeResponseRequest.py | danheath/temppykol | 7f9621b44df9f9d2d9fc0a5b2a06db116b9ccfab | [
"BSD-3-Clause"
] | 19 | 2015-05-28T09:36:19.000Z | 2022-03-15T23:19:29.000Z | from kol.request.GenericRequest import GenericRequest
from kol.manager import PatternManager
from kol.util import Report
import kol.Error as Error
class DeclineTradeResponseRequest(GenericRequest):
def __init__(self, session, tradeid):
super(DeclineTradeResponseRequest, self).__init__(session)
... | 48.35 | 143 | 0.719752 |
1990bc3f7148d809135c4f489d99d934c693a561 | 2,124 | py | Python | api_tests/nodes/views/test_node_implicit_contributors_list.py | chennan47/osf.io | 270608592b39a94941a3e329c0dc16d295a82472 | [
"Apache-2.0"
] | null | null | null | api_tests/nodes/views/test_node_implicit_contributors_list.py | chennan47/osf.io | 270608592b39a94941a3e329c0dc16d295a82472 | [
"Apache-2.0"
] | 3 | 2019-01-24T05:49:15.000Z | 2019-01-28T03:00:14.000Z | api_tests/nodes/views/test_node_implicit_contributors_list.py | udzuki/RDM-osf.io | cf5665dd7c933d00e56fd1c8cd795caa770bae0a | [
"Apache-2.0"
] | 1 | 2018-11-06T11:03:48.000Z | 2018-11-06T11:03:48.000Z | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
NodeFactory
)
@pytest.fixture()
def admin_contributor():
return AuthUserFactory()
@pytest.fixture()
def implicit_contributor():
return AuthUserFactory(given_name='Hen... | 35.4 | 137 | 0.696798 |
acd7e7047b359bb2033871d4fba886f1fad66dd8 | 1,471 | py | Python | helper_nodes/pointcloud_image_sync.py | apl-ocean-engineering/tof_sensor | 1a18b17f8ede8ab8cde86e80edcbe7dc4681c498 | [
"BSD-3-Clause"
] | null | null | null | helper_nodes/pointcloud_image_sync.py | apl-ocean-engineering/tof_sensor | 1a18b17f8ede8ab8cde86e80edcbe7dc4681c498 | [
"BSD-3-Clause"
] | null | null | null | helper_nodes/pointcloud_image_sync.py | apl-ocean-engineering/tof_sensor | 1a18b17f8ede8ab8cde86e80edcbe7dc4681c498 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Created on Wed Feb 27 12:32:07 2019
@author: mitchell
"""
import rospy
import std_msgs.msg
from sensor_msgs.msg import Image, PointCloud2
from cv_bridge import CvBridge, CvBridgeError
import cv2
class image_republish:
def __init__(self):
self.image_pub = rospy.Publisher... | 25.807018 | 103 | 0.60707 |
1a20e3032a2fcab17de308f00eb66876f7bad3b9 | 368 | py | Python | app/repositories/student_event_repo.py | jattoabdul/vanhack-cms | ab2cb054e35765531833afd98051027d891baf10 | [
"MIT"
] | null | null | null | app/repositories/student_event_repo.py | jattoabdul/vanhack-cms | ab2cb054e35765531833afd98051027d891baf10 | [
"MIT"
] | null | null | null | app/repositories/student_event_repo.py | jattoabdul/vanhack-cms | ab2cb054e35765531833afd98051027d891baf10 | [
"MIT"
] | null | null | null | from app.repositories.base_repo import BaseRepo
from app.models.student_event import StudentEvent
class StudentEventRepo(BaseRepo):
def __init__(self):
BaseRepo.__init__(self, StudentEvent)
def new_student_event(self, event_id, student_id):
student_event = StudentEvent(event_id=event_id, student_id=student_id... | 28.307692 | 72 | 0.817935 |
2d916d8de079410812c5c22e8f53e62980973d4b | 13,029 | py | Python | keras_question_and_answering_system/library/seq2seq_v2.py | chen0040/keras-question-and-answering-web-api | 8763beb11ac03a5f490ff6f02c41e29ccfbfc9b8 | [
"MIT"
] | 25 | 2017-12-29T03:55:43.000Z | 2022-03-22T03:55:04.000Z | keras_question_and_answering_system/library/seq2seq_v2.py | chen0040/keras-question-and-answering-web-api | 8763beb11ac03a5f490ff6f02c41e29ccfbfc9b8 | [
"MIT"
] | 3 | 2018-02-15T19:19:56.000Z | 2019-12-24T09:11:47.000Z | keras_question_and_answering_system/library/seq2seq_v2.py | chen0040/keras-question-and-answering-web-api | 8763beb11ac03a5f490ff6f02c41e29ccfbfc9b8 | [
"MIT"
] | 16 | 2018-01-11T15:09:47.000Z | 2022-01-09T08:44:40.000Z | from keras.callbacks import ModelCheckpoint
from keras.models import Model
from keras.layers import Input, LSTM, Dense, Embedding, Dropout, add, RepeatVector
from keras.preprocessing.sequence import pad_sequences
from keras_question_and_answering_system.library.utility import text_utils
from keras_question_and_answeri... | 50.696498 | 116 | 0.681019 |
71a6826a3a6beb118e7fb5071c6002e19ca9d91d | 9,885 | py | Python | tosca/services/wget2.py | aria-jpl/sar-availability | b553819fe3ba3bd75e533603294b6bb29bdbd9e2 | [
"Apache-2.0"
] | null | null | null | tosca/services/wget2.py | aria-jpl/sar-availability | b553819fe3ba3bd75e533603294b6bb29bdbd9e2 | [
"Apache-2.0"
] | 2 | 2020-07-06T15:17:58.000Z | 2020-09-08T14:55:55.000Z | tosca/services/wget2.py | aria-jpl/sar-availability | b553819fe3ba3bd75e533603294b6bb29bdbd9e2 | [
"Apache-2.0"
] | null | null | null | import os, json, requests, math, re
import hashlib
from datetime import datetime
import dateutil.parser
from flask import jsonify, Blueprint, request, url_for, Response
from flask_login import login_required
from pprint import pformat
import base64
import simplekml
from tosca import app
mod = Blueprint("services/kml",... | 31.682692 | 116 | 0.585837 |
aec1bf5d9e8708562a844d85d51417ff74b6c1aa | 13,887 | py | Python | mayan/apps/sources/views/document_views.py | lisuen/Mayan-EDMS | a3bda53893b8908e7f62b6d3242901901d27b069 | [
"Apache-2.0"
] | null | null | null | mayan/apps/sources/views/document_views.py | lisuen/Mayan-EDMS | a3bda53893b8908e7f62b6d3242901901d27b069 | [
"Apache-2.0"
] | null | null | null | mayan/apps/sources/views/document_views.py | lisuen/Mayan-EDMS | a3bda53893b8908e7f62b6d3242901901d27b069 | [
"Apache-2.0"
] | null | null | null | import logging
from django.contrib import messages
from django.http import HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.models ... | 37.736413 | 105 | 0.537121 |
dab191c1e89611441d84f991721c9cacef0e7652 | 6,696 | py | Python | tests/test_pysendyit.py | 0x6f736f646f/sendit-python | c7f2c8d7837547f691ed60b15d62166a15a7dbaa | [
"MIT"
] | 1 | 2021-07-12T09:36:25.000Z | 2021-07-12T09:36:25.000Z | tests/test_pysendyit.py | 0x6f736f646f/sendit-python | c7f2c8d7837547f691ed60b15d62166a15a7dbaa | [
"MIT"
] | 26 | 2020-05-24T23:33:30.000Z | 2021-07-04T13:48:30.000Z | tests/test_pysendyit.py | 0x6f736f646f/sendyit-python | c7f2c8d7837547f691ed60b15d62166a15a7dbaa | [
"MIT"
] | null | null | null | import unittest
import requests
import os
from pysendyit.pysendyit import Sendy
from pysendyit.errors import SendyException
api_username = os.getenv('API_USERNAME')
api_key = os.getenv('API_KEY')
base_url = os.getenv('BASE_URL')
class SendyTest(unittest.TestCase):
def setUp(self):
self.sendy = Sendy(api_... | 73.582418 | 492 | 0.750597 |
02663aa5470c59d11ca07400e80efc83041b3308 | 8,652 | py | Python | statsmodels/examples/ex_arch_canada.py | ginggs/statsmodels | a74a179d2a3267ed992871f8d9ef6c6d86c9b934 | [
"BSD-3-Clause"
] | 76 | 2019-12-28T08:37:10.000Z | 2022-03-29T02:19:41.000Z | statsmodels/examples/ex_arch_canada.py | ginggs/statsmodels | a74a179d2a3267ed992871f8d9ef6c6d86c9b934 | [
"BSD-3-Clause"
] | 1 | 2019-07-29T08:35:08.000Z | 2019-07-29T08:35:08.000Z | statsmodels/examples/ex_arch_canada.py | ginggs/statsmodels | a74a179d2a3267ed992871f8d9ef6c6d86c9b934 | [
"BSD-3-Clause"
] | 35 | 2020-02-04T14:46:25.000Z | 2022-03-24T03:56:17.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 24 07:31:47 2011
Author: Josef Perktold
"""
import numpy as np
import statsmodels.sandbox.stats.diagnostic as dia
canada_raw = '''\
405.36646642737 929.610513893698 7.52999999999884 386.136109062605
404.639833965913 929.803984550587 7.69999... | 54.415094 | 93 | 0.684928 |
7e34ec561c4b30254110a22eece3391805a5024b | 277 | py | Python | 02. Identify numerical and categorial data/categorial_trait.py | SausanCantik/descriptive-stats-phenotype-data | 04aab439530013b78cdf8f850d2f1c06fa73cbd7 | [
"MIT"
] | null | null | null | 02. Identify numerical and categorial data/categorial_trait.py | SausanCantik/descriptive-stats-phenotype-data | 04aab439530013b78cdf8f850d2f1c06fa73cbd7 | [
"MIT"
] | null | null | null | 02. Identify numerical and categorial data/categorial_trait.py | SausanCantik/descriptive-stats-phenotype-data | 04aab439530013b78cdf8f850d2f1c06fa73cbd7 | [
"MIT"
] | null | null | null | #A function to show the list of trait with categorial data
def categorial_trait(dataframe):
numeric, categorial = classifying_column(dataframe)
print('Traits with categorial data : ','\n',categorial, '\n')
print('Total count : ' ,len(categorial) , 'Traits')
| 39.571429 | 66 | 0.700361 |
55ae7d649b0d97d7a64edaffcea6319e916602d8 | 865 | py | Python | python/paddle/nn/initalizer.py | slf12/Paddle | fa43d74a3a16ac696db5dc893c9a7b1c6913dc85 | [
"Apache-2.0"
] | 1 | 2020-05-02T00:00:20.000Z | 2020-05-02T00:00:20.000Z | python/paddle/nn/initalizer.py | slf12/Paddle | fa43d74a3a16ac696db5dc893c9a7b1c6913dc85 | [
"Apache-2.0"
] | null | null | null | python/paddle/nn/initalizer.py | slf12/Paddle | fa43d74a3a16ac696db5dc893c9a7b1c6913dc85 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.269231 | 74 | 0.676301 |
e983b1fdab64d89fd3421b3177bdc203c5e8e42c | 1,332 | py | Python | stonehenge/db/migrations/migration.py | RobertTownley/stonehenge | 376b8e1501dd12ac1bcec5de680a5b521b0d949c | [
"MIT"
] | 1 | 2018-09-07T14:15:31.000Z | 2018-09-07T14:15:31.000Z | stonehenge/db/migrations/migration.py | RobertTownley/stonehenge | 376b8e1501dd12ac1bcec5de680a5b521b0d949c | [
"MIT"
] | 5 | 2018-09-06T01:48:12.000Z | 2021-05-08T10:47:00.000Z | stonehenge/db/migrations/migration.py | RobertTownley/stonehenge | 376b8e1501dd12ac1bcec5de680a5b521b0d949c | [
"MIT"
] | null | null | null | import json
import os
from typing import List
from stonehenge.db.operations import Operation
from stonehenge.db.migrations.exceptions import UnappliedMigrationException
class Migration:
def __init__(
self,
operations: List[Operation],
migrations_dir: str,
):
self.operations = ... | 28.340426 | 75 | 0.615616 |
8cb01eea00fa6ec102480781a60ee883b01c4f18 | 517 | py | Python | Packages/anaconda_php/plugin_version.py | prisis/sublime-text-packages | 99ae8a5496613e27a75e5bd91723549b21476e60 | [
"MIT"
] | null | null | null | Packages/anaconda_php/plugin_version.py | prisis/sublime-text-packages | 99ae8a5496613e27a75e5bd91723549b21476e60 | [
"MIT"
] | 1 | 2016-02-10T09:50:09.000Z | 2016-02-10T09:50:09.000Z | Packages/anaconda_php/plugin_version.py | prisis/sublime-text-packages | 99ae8a5496613e27a75e5bd91723549b21476e60 | [
"MIT"
] | null | null | null |
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import os
# Plugin version
messages_json = os.path.join(os.path.dirname(__file__), 'messages.json')
with open(messages_json, 'r') as message_file:
message_data = message_file.read()
ver... | 30.411765 | 74 | 0.715667 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.