index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
96,140 | rafiqul713/Smart-City | refs/heads/master | /WS/ws_api/views.py | from django.shortcuts import render
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from ws_api.models import WeatherStation
from ws_api.serializers import WeatherStationSerializer
from django.http imp... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,141 | rafiqul713/Smart-City | refs/heads/master | /WS/ws_api/admin.py | from django.contrib import admin
from .models import WeatherStation
# Register your models here.
admin.site.register(WeatherStation)
| {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,142 | rafiqul713/Smart-City | refs/heads/master | /SLMS/api/serializers.py | from rest_framework import serializers
from .models import StreetLight
class StreetLightSerializer(serializers.ModelSerializer):
class Meta:
model= StreetLight
fields=('device_id','light_status')
def create(self, validated_data):
return StreetLight.objects.create(**validated_d... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,143 | rafiqul713/Smart-City | refs/heads/master | /WS/ws_api/apps.py | from django.apps import AppConfig
class WsApiConfig(AppConfig):
name = 'ws_api'
| {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,144 | rafiqul713/Smart-City | refs/heads/master | /WS/ws_api/migrations/0001_initial.py | # Generated by Django 3.1 on 2020-08-30 09:20
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='WeatherStation',
fields=[
('device_id', model... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,145 | rafiqul713/Smart-City | refs/heads/master | /SLMS/api/views.py | from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from api.models import StreetLight
from api.serializers import StreetLightSerializer
from django.http import HttpResponse
class SLMS_API(APIView):
... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,146 | rafiqul713/Smart-City | refs/heads/master | /WS/ws_api/sensors.py | class Sensor:
def read_temperature(self):
return "Temperature"
def read_humidity(self):
return "Humidity"
def read_solarradiation(self):
return "Solar Radiation"
def read_visibility(self):
return "Visibility"
def read_winddirectionchange(self):
return "Wi... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,147 | rafiqul713/Smart-City | refs/heads/master | /MQTT_testing/client.py | import paho.mqtt.client as mqtt
def on_message(mqttc, obj, msg):
print(msg.topic + " " + str(msg.qos) + " " + str(msg.payload))
host="mqtt.eclipse.org"
topic="sensor/temperature"
port=1883
mqttc = mqtt.Client()
mqttc.on_message = on_message
mqttc.connect(host,port,60)
mqttc.subscribe(topic, 0)
mqttc.loop_foreve... | {"/SLMS/api/admin.py": ["/SLMS/api/models.py"], "/SLMS/api/serializers.py": ["/SLMS/api/models.py"]} |
96,151 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/views.py | from django.shortcuts import render
from .models import MovieItem, CommentItem
from django.http import HttpResponseRedirect, HttpResponse
import requests
from django.db.models import Count
from django.template.defaulttags import register
from django.views.decorators.csrf import csrf_exempt
@register.filter
def get_it... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,152 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/apps.py | from django.apps import AppConfig
class MoviesLibConfig(AppConfig):
name = 'movies_lib'
| {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,153 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/migrations/0002_auto_20200405_1253.py | # Generated by Django 2.2.5 on 2020-04-05 10:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies_lib', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='movieitem',
name='author',
... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,154 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/migrations/0007_movieitem_poster.py | # Generated by Django 2.2.5 on 2020-04-07 15:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies_lib', '0006_auto_20200405_1714'),
]
operations = [
migrations.AddField(
model_name='movieitem',
name='poster'... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,155 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/migrations/0003_auto_20200405_1256.py | # Generated by Django 2.2.5 on 2020-04-05 10:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('movies_lib', '0002_auto_20200405_1253'),
]
operations = [
migrations.RenameField(
model_name='movieitem',
old_name='author',... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,156 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/migrations/0006_auto_20200405_1714.py | # Generated by Django 2.2.5 on 2020-04-05 15:14
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('movies_lib', '0005_commentitem'),
]
operations = [
migrations.RenameField(
model_name='commentitem'... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,157 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/admin.py | from django.contrib import admin
from .models import MovieItem
admin.site.register(MovieItem)
| {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,158 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/migrations/0004_movieitem_full_data.py | # Generated by Django 2.2.5 on 2020-04-05 13:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies_lib', '0003_auto_20200405_1256'),
]
operations = [
migrations.AddField(
model_name='movieitem',
name='full_da... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,159 | Smilejarik/movies-rest | refs/heads/master | /movies_lib/models.py | from django.db import models
from django.utils import timezone
class MovieItem(models.Model):
title = models.TextField(max_length=50, blank=False)
year = models.TextField(max_length=4, default='null')
director = models.TextField(max_length=50, default='Unknown')
poster = models.TextField(default='Not available')
... | {"/movies_lib/views.py": ["/movies_lib/models.py"], "/movies_lib/admin.py": ["/movies_lib/models.py"]} |
96,206 | Freezzes/foodproject | refs/heads/master | /bistro/models.py | from django.db import models
import datetime
from django.utils import timezone
# Create your models here.
class Category(models.Model):
category_name = models.CharField(max_length=20)
def __str__(self):
return self.category_name
class Shop(models.Model):
category = models.ForeignKey(Ca... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,207 | Freezzes/foodproject | refs/heads/master | /bistro/urls.py | from django.urls import path
from . import views
app_name = 'bistro'
urlpatterns = [
path('', views.Homepage.as_view(), name='index'),
path('search/',views.search_name,name='search'),
path('searchname/',views.result,name='searchname'),
path('find/', views.Category_View.as_view(), name='find'),
pa... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,208 | Freezzes/foodproject | refs/heads/master | /bistro/migrations/0004_auto_20190217_2059.py | # Generated by Django 2.1.4 on 2019-02-17 13:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bistro', '0003_auto_20190217_2048'),
]
operations = [
migrations.RemoveField(
model_name='categ... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,209 | Freezzes/foodproject | refs/heads/master | /bistro/migrations/0005_review_review_date.py | # Generated by Django 2.1.4 on 2019-02-18 09:13
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('bistro', '0004_auto_20190217_2059'),
]
operations = [
migrations.AddField(
... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,210 | Freezzes/foodproject | refs/heads/master | /bistro/views.py | from django.http import HttpResponse ,HttpResponseRedirect
from django.shortcuts import get_object_or_404,render
from django.http import Http404
from django.urls import reverse
from .models import Shop,Review,Category
from django.views import generic
import random
import datetime
from django.utils import timezone
# Cr... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,211 | Freezzes/foodproject | refs/heads/master | /bistro/migrations/0003_auto_20190217_2048.py | # Generated by Django 2.1.4 on 2019-02-17 13:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bistro', '0002_auto_20190217_2044'),
]
operations = [
migrations.AlterField(
model_name='shop',
name='explanation',
... | {"/bistro/views.py": ["/bistro/models.py"]} |
96,212 | Elsenosy/beeBrain | refs/heads/master | /samples/nn_samples/regression_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,213 | Elsenosy/beeBrain | refs/heads/master | /samples/nn_samples/save_restore_model_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,214 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/initializers.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,215 | Elsenosy/beeBrain | refs/heads/master | /samples/nn_samples/cnn_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,216 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/saver.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,217 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/optimizers.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,218 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/dataloader.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,219 | Elsenosy/beeBrain | refs/heads/master | /samples/nn_samples/classifier_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,220 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/metrics.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,221 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/losses.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,222 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/activations.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,223 | Elsenosy/beeBrain | refs/heads/master | /samples/ga_samples/string_generator_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,224 | Elsenosy/beeBrain | refs/heads/master | /samples/ga_samples/find_path_sample.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,225 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/neuralNetworks/module.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,226 | Elsenosy/beeBrain | refs/heads/master | /beeBrain/geneticAlgorithm/ga.py | '''
beeBrain - An Artificial Intelligence & Machine Learning library
by Dev. Ibrahim Said Elsharawy (www.devhima.tk)
'''
''''
MIT License
Copyright (c) 2019 Ibrahim Said Elsharawy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "So... | {"/beeBrain/neuralNetworks/losses.py": ["/beeBrain/neuralNetworks/activations.py"]} |
96,228 | oiwn/mongo-cookies | refs/heads/master | /cli.py | import logging
import argparse
from settings import TASKS
from utils.moduleimport import module_import
logger = logging.getLogger('cli')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='command line interface')
parser.add_argument('-T', '--task', type=str,
h... | {"/workout.py": ["/settings.py"], "/aggregation/groupby.py": ["/workout.py"], "/aggregation/find_duplicates.py": ["/workout.py"]} |
96,229 | oiwn/mongo-cookies | refs/heads/master | /workout.py | """ Base class to build mongodb cookies
"""
from settings import db_connection
class MongoWorkout(object):
db = None
name = 'default' # name of example
collection = 'test' # define collection used
def __init__(self):
self.db = db_connection()
# prepare run and cleanup database
... | {"/workout.py": ["/settings.py"], "/aggregation/groupby.py": ["/workout.py"], "/aggregation/find_duplicates.py": ["/workout.py"]} |
96,230 | oiwn/mongo-cookies | refs/heads/master | /settings.py | import logging
from pymongo import MongoClient
DEBUG = True
LOG_LEVEL = logging.DEBUG
logging.basicConfig(format='%(levelname)s: %(message)s')
# http://docs.mongodb.org/manual/reference/connection-string/
MONGO_DB_NAME = 'mongocookies'
MONGO_DB_URI = 'mongodb://localhost:27017/{}'.format(MONGO_DB_NAME)
# mapping fo... | {"/workout.py": ["/settings.py"], "/aggregation/groupby.py": ["/workout.py"], "/aggregation/find_duplicates.py": ["/workout.py"]} |
96,231 | oiwn/mongo-cookies | refs/heads/master | /aggregation/groupby.py | import pprint
import logging
from faker import Factory
from workout import MongoWorkout
logger = logging.getLogger(__name__)
class GroupBySimple(MongoWorkout):
""" Show how to group elements
"""
name = 'GroupBySimple'
collection = 'groupbysimple'
# pipeline to find duplicates
pipeline = []
... | {"/workout.py": ["/settings.py"], "/aggregation/groupby.py": ["/workout.py"], "/aggregation/find_duplicates.py": ["/workout.py"]} |
96,232 | oiwn/mongo-cookies | refs/heads/master | /aggregation/find_duplicates.py | import pprint
import logging
from faker import Factory
from workout import MongoWorkout
logger = logging.getLogger(__name__)
class FindDuplicates(MongoWorkout):
""" Show how to find duplicates from file
using aggregation pipeline
"""
name = 'RemoveDuplicates'
collection = 'removeDuplicates'
... | {"/workout.py": ["/settings.py"], "/aggregation/groupby.py": ["/workout.py"], "/aggregation/find_duplicates.py": ["/workout.py"]} |
96,242 | paivett/requests-curl | refs/heads/master | /tests/test_pool_provider.py | import pytest
from requests.exceptions import InvalidProxyURL
from requests_curl.pool_provider import CURLPoolProvider
from requests_curl.pool import CURLHandlerPool, ProxyCURLHandlerPool
def test_can_create_empty_pool_provider():
pool_provider = CURLPoolProvider(
max_pools=0,
max_pool_size=10,
... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,243 | paivett/requests-curl | refs/heads/master | /tests/test_adapter.py | import pytest
import pycurl
from collections import deque
from requests import PreparedRequest
from requests.exceptions import (
ConnectionError,
ReadTimeout,
SSLError,
ProxyError,
ConnectTimeout,
)
from requests_curl.adapter import CURLAdapter
from requests_curl.response import CURLResponse
de... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,244 | paivett/requests-curl | refs/heads/master | /requests_curl/error.py | import pycurl
import re
from requests.exceptions import (
ConnectionError,
ConnectTimeout,
ReadTimeout,
SSLError,
ProxyError,
)
_PYCURL_SSL_ERRORS = {
pycurl.E_SSL_CACERT,
pycurl.E_SSL_CACERT_BADFILE,
pycurl.E_SSL_CERTPROBLEM,
pycurl.E_SSL_CIPHER,
pycurl.E_SSL_CONNECT_ERROR,
... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,245 | paivett/requests-curl | refs/heads/master | /requests_curl/pool_provider.py | from itertools import chain
from urllib3.poolmanager import PoolManager
from urllib3.util import parse_url
from requests.utils import prepend_scheme_if_needed
from requests.exceptions import InvalidProxyURL
from .pool import CURLHandlerPool, ProxyCURLHandlerPool
class CURLPoolProvider(object):
"""This class prov... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,246 | paivett/requests-curl | refs/heads/master | /tests_e2e/test_auth.py | import requests
from requests.auth import HTTPBasicAuth
from requests_curl.adapter import CURLAdapter
from tests_e2e import HTTP_BIN_BASE_URL
def test_successful_basic_auth():
session = requests.Session()
session.mount("http://", CURLAdapter())
user = "someuser"
pwd = "somepwd"
url = f"{HTTP_B... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,247 | paivett/requests-curl | refs/heads/master | /requests_curl/pool.py | import pycurl
from six.moves import queue, range
from .response import CURLResponse
class PoolException(Exception):
pass
class EmptyPool(PoolException):
pass
class ClosedPool(PoolException):
pass
class CURLHandlerPool(object):
"""Thread-safe connection pool for one host. Tries to emulate HTTPC... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,248 | paivett/requests-curl | refs/heads/master | /tests_e2e/test_method.py | import pytest
import requests
from requests_curl.adapter import CURLAdapter
from tests_e2e import HTTP_BIN_BASE_URL
@pytest.mark.parametrize(
"method",
(
"get",
"post",
"put",
"delete",
"patch",
),
)
def test_method(method):
session = requests.Session()
se... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,249 | paivett/requests-curl | refs/heads/master | /setup.py | from setuptools import setup
setup(
name='requests_curl',
version='0.1',
packages=['requests_curl'],
install_requires=['requests>=2.0.0', 'pycurl>=7.43.0.2', 'six>=1.11.0'],
provides=['requests_curl'],
author='Santiago Pivetta',
author_email='santiago.pivetta@gmail.com',
url='https://gi... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,250 | paivett/requests-curl | refs/heads/master | /tests/test_request.py | # -*- coding: utf-8 -*
import pycurl
import pytest
import six
from requests import PreparedRequest
from requests.adapters import DEFAULT_CA_BUNDLE_PATH
from requests_curl.request import CURLRequest
def test_request_property():
prepared_request = PreparedRequest()
curl_request = CURLRequest(prepared_request)
... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,251 | paivett/requests-curl | refs/heads/master | /requests_curl/request.py | import os
import six
import pycurl
from requests.adapters import DEFAULT_CA_BUNDLE_PATH
class CURLRequest(object):
"""Representation of a request to be made using CURL."""
def __init__(self, request, timeout=None, verify=None, cert=None):
"""Initializes a CURL request from a given prepared request
... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,252 | paivett/requests-curl | refs/heads/master | /tests_e2e/test_cookies.py | import requests
from requests_curl import CURLAdapter
from tests_e2e import HTTP_BIN_BASE_URL
def test_empty_cookies_when_no_cookies_were_set():
session = requests.Session()
session.mount("http://", CURLAdapter())
url = f"{HTTP_BIN_BASE_URL}/cookies"
response = session.get(url)
assert not re... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,253 | paivett/requests-curl | refs/heads/master | /requests_curl/adapter.py | """Requests adapter implementing a CURL backend"""
import pycurl
from requests.exceptions import RequestException
from requests.utils import select_proxy
from requests.adapters import (
BaseAdapter,
DEFAULT_RETRIES,
DEFAULT_POOLSIZE,
DEFAULT_POOLBLOCK,
)
from urllib3.util.retry import Retry
from urlli... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,254 | paivett/requests-curl | refs/heads/master | /tests_e2e/test_headers.py | import requests
from requests_curl.adapter import CURLAdapter
from tests_e2e import HTTP_BIN_BASE_URL
def test_headers():
session = requests.Session()
session.mount("http://", CURLAdapter())
url = f"{HTTP_BIN_BASE_URL}/headers"
headers_to_send = {
"User-Agent": "my-app/0.0.1",
"Dn... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,255 | paivett/requests-curl | refs/heads/master | /requests_curl/__init__.py | from .adapter import CURLAdapter
__all__ = [
"CURLAdapter",
]
| {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,256 | paivett/requests-curl | refs/heads/master | /requests_curl/response.py | import io
import six
from http.client import parse_headers
from requests import Response as RequestResponse
from requests.utils import get_encoding_from_headers
from requests.structures import CaseInsensitiveDict
from requests.cookies import extract_cookies_to_jar
from urllib3.response import HTTPResponse as URLLib3Rr... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,257 | paivett/requests-curl | refs/heads/master | /tests_e2e/__init__.py | import os
HTTP_BIN_HOST = os.environ.get("HTTP_BIN_HOST", "localhost")
HTTP_BIN_BASE_URL = f"http://{HTTP_BIN_HOST}"
| {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,258 | paivett/requests-curl | refs/heads/master | /tests/test_pool.py | import pycurl
import pytest
from requests import PreparedRequest
from urllib3.util import parse_url
from requests_curl.pool import (
CURLHandlerPool,
ClosedPool,
EmptyPool,
ProxyCURLHandlerPool,
)
from requests_curl.request import CURLRequest
class FakeCurlHandler:
def __init__(self):
se... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,259 | paivett/requests-curl | refs/heads/master | /tests/test_response.py | import pytest
from requests import PreparedRequest, Response
from requests_curl.response import CURLResponse
from requests_curl.request import CURLRequest
def test_create_empty_curl_response():
prepared_request = PreparedRequest()
prepared_request.prepare(url="http://somefakeurl", method="GET", headers={})
... | {"/tests/test_pool_provider.py": ["/requests_curl/pool_provider.py", "/requests_curl/pool.py"], "/tests/test_adapter.py": ["/requests_curl/adapter.py", "/requests_curl/response.py"], "/requests_curl/pool_provider.py": ["/requests_curl/pool.py"], "/tests_e2e/test_auth.py": ["/requests_curl/adapter.py", "/tests_e2e/__ini... |
96,262 | boscoh/peptagram | refs/heads/master | /peptagram/parse.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import re
import os
import json
import glob
import logging
import ntpath, posixpath, macpath
"""
Utility parsing functions for strings and files.
"""
# string parsers
float_regex_pattern = r"""
^
[-+]? # optional sign
(?:
... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,263 | boscoh/peptagram | refs/heads/master | /peptagram/peptidemass.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
"""
Routines to calculate mass-spectra of peptide sequences.
"""
atom_mass = {
'H': 1.007825032,
'H+': 1.007276,
'O': 15.994914622,
}
ave_atom_mass = {
'H': 1.00794,
'O': 15.9994,
}
aa_monoisot... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,264 | boscoh/peptagram | refs/heads/master | /peptagram/morpheus.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import os
import json
import csv
import logging
logger = logging.getLogger('morpheus')
import parse
import proteins as parse_proteins
import peptidemass
"""
Parser for Morpheus .TSV files for mass-spec search results
Main A... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,265 | boscoh/peptagram | refs/heads/master | /make_batch.py | import glob
import os
import shutil
batch_template = """\
start python %s -i
"""
shell_template = """\
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
python %(py_script)s $*
if [ "$(uname)" == "Darwin" ]; then
echo -n -e "\033]0;%(window_name)s\007"
osascript -e 'tell application "Terminal" to cl... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,266 | boscoh/peptagram | refs/heads/master | /pymzml/minimum.py | # pymzml
#
# Copyright (C) 2010-2011 T. Bald, J. Barth, M. Specht, C. Fufezan
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,267 | boscoh/peptagram | refs/heads/master | /setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='peptagram',
version='0.5',
author='Bosco Ho',
author_email='boscoh@gmail.com',
url='http://boscoh.github.io/peptagram',
description='python scripts to generate javascript visualization for proteomics data',
long_description="D... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,268 | boscoh/peptagram | refs/heads/master | /peptagram/mascot.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import math
import urllib
import xml.etree.ElementTree as etree
import logging
logger = logging.getLogger('mascot')
from parse import parse_string, save_data_dict
import proteins as parse_proteins
"""
Parser for Mascot dat fi... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,269 | boscoh/peptagram | refs/heads/master | /peptagram/maxquant.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import os
import logging
logger = logging.getLogger('maxquant')
import parse
import proteins as parse_proteins
"""
Parser for Maxquant search-results text files in the summary directory
Main API entry:
get_proteins_and_s... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,270 | boscoh/peptagram | refs/heads/master | /peptagram/mzml.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import pymzml
"""
Loads specific MS-MS spectra from an mzML file into
an existing proteins data structure.
"""
def load_mzml_into_matches(matches, mzml, n_peak=50):
get_scan_id = lambda match: match['attr']['scan_id']
mat... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,271 | boscoh/peptagram | refs/heads/master | /peptagram/templates/comparison/copyback_comparison.py | #!/usr/bin/env python
"""
Assuming prototyping is done in the peptagram here,
copies the modified js back into the master python
template directory.
"""
import os
import shutil
import peptagram
fname_pairs = """
copyback_comparison.py templates/comparison/
index.html templates/comparison/
js/peptagram.js template... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,272 | boscoh/peptagram | refs/heads/master | /do_maxquant_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from __future__ import print_function
import glob
import os
import sys
import webbrowser
import logging
import tkform
import peptagram.proteins
import peptagram.maxquant
from peptagram import parse
test_params = {
'files_and_labels': [('example_data/maxquant/sum... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,273 | boscoh/peptagram | refs/heads/master | /peptagram/prophet.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import xml.etree.ElementTree as etree
import logging
logger = logging.getLogger('prophet')
import parse
import proteins as parse_proteins
"""
Parsers for ProteinProphet and PeptideProphet XML search results.
Main API entry:
... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,274 | boscoh/peptagram | refs/heads/master | /tkform.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
tkform provides an HTML-inspired form-based GUI
for Python scripts.
Includes
- scrollable page
- simple entry of params
- reordable lists of files or directories
"""
import os
import traceback
import re
import collections
import Tkinter as tk
import tkFileDial... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,275 | boscoh/peptagram | refs/heads/master | /do_mascot_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from __future__ import print_function
import glob
import os
import sys
import webbrowser
import logging
import tkform
import peptagram.proteins
from peptagram import parse
import peptagram.mascot
test_params = {
'files_and_labels': [('example_data/mascot/F022043... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,276 | boscoh/peptagram | refs/heads/master | /peptagram/xtandem.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import re
import math
import xml.etree.ElementTree as etree
import logging
logger = logging.getLogger('xtandem')
import parse
import proteins as proteins_module
import peptidemass
"""
Parser for X!Tandem XML mass-spec search ... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,277 | boscoh/peptagram | refs/heads/master | /do_prophet_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from __future__ import print_function
import glob
import os
import sys
import webbrowser
import logging
import tkform
import peptagram.prophet
import peptagram.proteins
from peptagram import parse
test_params = {
'prot_xml': 'example_data/prophet/hca-lysate-... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,278 | boscoh/peptagram | refs/heads/master | /run_test.py | import os, glob
for py in glob.glob('*_peptagram.py'):
if 'reorder' not in py:
os.system('python {} test'.format(py)) | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,279 | boscoh/peptagram | refs/heads/master | /do_pilot_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from __future__ import print_function
import glob
import os
import sys
import webbrowser
import logging
import tkform
import peptagram.proteins
import peptagram.pilot
from peptagram import parse
import tkform
test_params = {
'files_and_labels': [('example_data... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,280 | boscoh/peptagram | refs/heads/master | /do_morpheus_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from __future__ import print_function
import glob
import os
import sys
import webbrowser
import logging
import tkform
import peptagram.morpheus
import peptagram.mzml
import peptagram.proteins
from peptagram import parse
test_params = {
'files_and_labels': [('ex... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,281 | boscoh/peptagram | refs/heads/master | /do_reorder_peptagram.py | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import os
import json
import webbrowser
import logging
import peptagram.proteins
from peptagram import parse
import Tkinter as tk
import tkFileDialog
import tkform
def load_data_jsonp(data_jsonp):
with open(data_jsonp) as f:
txt = f.read()
i_bracke... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,282 | boscoh/peptagram | refs/heads/master | /peptagram/pilot.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import csv
import logging
logger = logging.getLogger('pilot')
import proteins as parse_proteins
"""
Parser for AB/X Protein Pilot search results saved as CSV text file
Main API entry:
get_proteins(fname)
returns a dic... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,283 | boscoh/peptagram | refs/heads/master | /peptagram/proteins.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
import math
import os
import json
import copy
import glob
import shutil
from pprint import pprint
import logging
logger = logging.getLogger('proteins')
import parse
"""
Data structure manipulation routines for the key protei... | {"/do_maxquant_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/maxquant.py"], "/do_mascot_peptagram.py": ["/tkform.py", "/peptagram/proteins.py", "/peptagram/mascot.py"], "/do_prophet_peptagram.py": ["/tkform.py", "/peptagram/prophet.py", "/peptagram/proteins.py"], "/do_pilot_peptagram.py": ["/tkfor... |
96,306 | babykick/bttt99 | refs/heads/master | /bttt99/__init__.py | __author__ = """Stephen Chen"""
__email__ = 'noemail@noemail.com'
__version__ = '0.1'
from .extractors.gaoqingfm import Gaoqingfm
EX_mapping = {
'gaoqingfm': Gaoqingfm
}
def get_extractor(name):
return EX_mapping.get(name)
| {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,307 | babykick/bttt99 | refs/heads/master | /bttt99/cli.py | import click
from .core import search
from .common import copy_to_clipboard, find_subtitle
@click.command()
@click.argument('moviename', required=False)
@click.option('--subtitle', '-s', help='Given keyword(usually the file name) to search')
def main(moviename, subtitle):
if moviename:
search(moviename)
... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,308 | babykick/bttt99 | refs/heads/master | /bttt99/extractors/bttt99.py | """
Grab the torrent from bttt99 website.
"""
from .base import BaseExtractor
class Bttt99Extractor(BaseExtractor):
def search(self, name):
html = self.get_html(SEARCH_URL, params={'q': name})
doc = lxml.html.fromstring(html)
xp = doc.xpath('//div[@class="taginfo"]//a')
if xp:
... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,309 | babykick/bttt99 | refs/heads/master | /bttt99/common.py | import re
import urllib.parse
import requests
import pyperclip
import lxml.html as H
SUBTITLE_SEARCH_URL = 'http://assrt.net/sub/?searchword={}'
DOWNLOAD_BASE_URL = 'http://assrt.net/'
def copy_to_clipboard(text):
pyperclip.copy(text)
def find_subtitle(keyword):
session = requests.session()
session.h... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,310 | babykick/bttt99 | refs/heads/master | /bttt99/extractors/base.py | import re
import os
import urllib.parse
import concurrent.futures
import itertools
import reprlib
from collections import namedtuple
import lxml.html
import requests
from ..common import copy_to_clipboard, find_subtitle
BASE_URL = 'http://www.bttt99.com/'
TAGS_URL = 'http://www.bttt99.com/tag/'
SEARCH_URL = 'http:/... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,311 | babykick/bttt99 | refs/heads/master | /bttt99/core.py | """
API and command-line interface
"""
from . import get_extractor
default_extractor = 'gaoqingfm'
def search(keyword):
Extractor = get_extractor(default_extractor)
if not Extractor:
raise TypeError('No proper extractor found by {}'.format(default_extractor))
extractor = Extractor()
extract... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,312 | babykick/bttt99 | refs/heads/master | /bttt99/extractors/gaoqingfm.py | import lxml.html as H
from .base import BaseExtractor, Torrent
SEARCH_URL = 'https://gaoqing.fm/api/search?search={}&limit=100&page=1'
class Gaoqingfm(BaseExtractor):
"""
Grab data by REST api from http://m.gaoqing.fm/
torrents list:
{'count': '1',
'films': [{'country': '美国',
'... | {"/bttt99/__init__.py": ["/bttt99/extractors/gaoqingfm.py"], "/bttt99/cli.py": ["/bttt99/core.py", "/bttt99/common.py"], "/bttt99/extractors/bttt99.py": ["/bttt99/extractors/base.py"], "/bttt99/extractors/base.py": ["/bttt99/common.py"], "/bttt99/core.py": ["/bttt99/__init__.py"], "/bttt99/extractors/gaoqingfm.py": ["/... |
96,410 | Dreaucis/TableTennis | refs/heads/master | /CreateDatabases.py | import sqlite3
db = sqlite3.connect('table_tennis.db')
cursor = db.cursor()
# Creating players table
cursor.execute("""
CREATE TABLE IF NOT EXISTS players(
id INTEGER,
name STRING,
password STRING
)
""")
# Creating game history table
cursor.execute("""
CREATE TABLE IF NOT EXISTS games(
id INTEGER,
id_player_1 INTEG... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,411 | Dreaucis/TableTennis | refs/heads/master | /Session.py | from Game import Game
from Ladder import Ladder
from Player import Player
from RuleError import RuleError
import sqlite3
class Session:
def __init__(self):
"""
Connects to the sqlite table_tennis database
"""
self.db = sqlite3.connect('table_tennis.db')
def getIdsAndNames(self... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,412 | Dreaucis/TableTennis | refs/heads/master | /tmp.py | import sqlite3
db = sqlite3.connect('table_tennis.db')
cursor = db.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS users(
id INTEGER,
name STRING,
password STRING
)
""")
#cursor.execute("""INSERT INTO users(id,name,password) VALUES(2,'hst','ap')""")
ranks = cursor.execute(""" SELECT id FROM users WHERE name... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,413 | Dreaucis/TableTennis | refs/heads/master | /RuleError.py | class RuleError(Exception):
def __init__(self, rank_1, rank_2):
self.rank_1 = rank_1
self.rank_2 = rank_2
| {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,414 | Dreaucis/TableTennis | refs/heads/master | /Game.py | import sqlite3
import numpy as np
from Connector import Connector
class Game(Connector):
# Initialization
def __init__(self, id_player_1,id_player_2,score_player_1,score_player_2,db_cursor):
super.__init__(db_cursor)
self.dict = {'id': self.getNextId(),
'id_player_1': id_p... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,415 | Dreaucis/TableTennis | refs/heads/master | /Player.py | from Connector import Connector
class Player(Connector):
def __init__(self, db_cursor):
super.__init__(db_cursor)
# Methods
def addPlayer(self, name):
# Add player If the player name is not taken
if not self.db_cursor.execute(""" SELECT * FROM players WHERE name = ? """, (name,)).... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,416 | Dreaucis/TableTennis | refs/heads/master | /Ladder.py | from Connector import Connector
from RuleError import RuleError
class Ladder(Connector):
def __init__(self, db_cursor):
super.__init__(db_cursor)
def addPlayer(self, name):
# Add player If the player name is not taken
id_player = self.db_cursor.execute(""" SELECT id FROM players WHERE... | {"/Session.py": ["/Game.py", "/Ladder.py", "/Player.py", "/RuleError.py"], "/Ladder.py": ["/RuleError.py"]} |
96,457 | y3rsh/discuss | refs/heads/master | /tests/test_compute.py | import pytest
from hypothesis import given
import hypothesis.strategies as st
@given(st.integers(min_value=-1, max_value=3))
def test_compute(param1):
print(f"{param1 = }") # 3.8 😉
assert param1 < 4 | {"/tests/test_max_repeating_chars.py": ["/max_repeating_chars.py"]} |
96,458 | y3rsh/discuss | refs/heads/master | /max_repeating_chars.py | import collections
from typing import Tuple
def max_repeating_chars(input: str) -> Tuple[bool, int]:
"""
Return the max number of repeating characters in a string
and a boolean describing the validity of the passed string.
Do not trust the passed parameter and exit fast with false
validity and len... | {"/tests/test_max_repeating_chars.py": ["/max_repeating_chars.py"]} |
96,459 | y3rsh/discuss | refs/heads/master | /tests/test_braces.py | import pytest
def fail_fast(expression):
if not expression or len(expression) % 2 != 0:
return True
return False
def is_matched(expression):
if fail_fast(expression):
return False
mapping = {"(": ")", "{": "}", "[": "]"}
queue = []
for letter in expression:
if letter ... | {"/tests/test_max_repeating_chars.py": ["/max_repeating_chars.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.