repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pytorch_transformers/tests/tokenization_xlm_test.py | LAL-Parser/src_joint/pytorch_transformers/tests/tokenization_xlm_test.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pytorch_transformers/tests/modeling_auto_test.py | LAL-Parser/src_joint/pytorch_transformers/tests/modeling_auto_test.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pytorch_transformers/tests/tokenization_bert_test.py | LAL-Parser/src_joint/pytorch_transformers/tests/tokenization_bert_test.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/modeling.py | LAL-Parser/src_joint/pretrained_bert/modeling.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | true |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/file_utils.py | LAL-Parser/src_joint/pretrained_bert/file_utils.py | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import os
import logging
import shutil
import tempfile
import json
from urllib.parse import urlparse
from pathlib import Path
from typing ... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/tokenization.py | LAL-Parser/src_joint/pretrained_bert/tokenization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/optimization.py | LAL-Parser/src_joint/pretrained_bert/optimization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/__main__.py | LAL-Parser/src_joint/pretrained_bert/__main__.py | # coding: utf8
def main():
import sys
try:
from .convert_tf_checkpoint_to_pytorch import convert_tf_checkpoint_to_pytorch
except ModuleNotFoundError:
print("pytorch_pretrained_bert can only be used from the commandline to convert TensorFlow models in PyTorch, "
"In that case, i... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/__init__.py | LAL-Parser/src_joint/pretrained_bert/__init__.py | __version__ = "0.4.0"
from .tokenization import BertTokenizer, BasicTokenizer, WordpieceTokenizer
from .modeling import (BertConfig, BertModel, BertForPreTraining,
BertForMaskedLM, BertForNextSentencePrediction,
BertForSequenceClassification, BertForMultipleChoice,
... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/LAL-Parser/src_joint/pretrained_bert/convert_tf_checkpoint_to_pytorch.py | LAL-Parser/src_joint/pretrained_bert/convert_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HugginFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/data_utils.py | DualGCN/data_utils.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import os
import sys
sys.path.append(r'./LAL-Parser/src_joint')
import re
import json
import pickle
import numpy as np
from tqdm import tqdm
from transformers import BertTokenizer
from torch.utils.data import Dataset
def ParseData(data_path):
... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/train.py | DualGCN/train.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import os
import sys
import copy
import random
import logging
import argparse
import torch
import torch.nn as nn
import numpy as np
from sklearn import metrics
from time import strftime, localtime
from torch.utils.data import DataLoader
from tran... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/prepare_vocab.py | DualGCN/prepare_vocab.py | """
Prepare vocabulary and initial word vectors.
"""
import json
import tqdm
import pickle
import argparse
import numpy as np
from collections import Counter
class VocabHelp(object):
def __init__(self, counter, specials=['<pad>', '<unk>']):
self.pad_index = 0
self.unk_index = 1
counter = co... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/tree.py | DualGCN/tree.py | """
Basic operations on trees.
"""
import numpy as np
from collections import defaultdict
import copy
class Tree(object):
"""
Reused tree object from stanfordnlp/treelstm.
"""
def __init__(self):
self.parent = None
self.num_children = 0
self.children = list()
def add_chil... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/layers.py | DualGCN/layers.py | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class DynamicLSTM(nn.Module):
'''
LSTM which can hold variable length sequence, use like TensorFlow's RNN(input, lenght...).
'''
def __init__(self, input_size, hidden_size, num_layers=1, bias=True, batch_first=True, dropout=... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/dualgcn.py | DualGCN/models/dualgcn.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import copy
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from tree import head_to_tree, tree_to_adj
class DualGCNClassifier(nn.Module):
def __init__(se... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/semgcn.py | DualGCN/models/semgcn.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import copy
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class SemGCNClassifier(nn.Module):
def __init__(self, embedding_matrix, opt):
super().... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/ian.py | DualGCN/models/ian.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import DynamicLSTM, Attention
class IAN(nn.Module):
def __init__(self, embedding_matrix, opt):
super(IAN, self).__init__()
self.opt = opt
... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/atae_lstm.py | DualGCN/models/atae_lstm.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from layers import DynamicLSTM, SqueezeEmbedding, SoftAttention
class ATAE_LSTM(nn.Module):
''' Attention-based LSTM with Aspect Embedding '''
def __init__(self, embeddi... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/syngcn.py | DualGCN/models/syngcn.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from tree import head_to_tree, tree_to_adj
class SynGCNClassifier(nn.Module):
def __init__(self, embedding_matrix, opt... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
CCChenhao997/DualGCN-ABSA | https://github.com/CCChenhao997/DualGCN-ABSA/blob/e8975264b0802f1fca4ebbc96f30a03ec2717311/DualGCN/models/dualgcn_bert.py | DualGCN/models/dualgcn_bert.py | '''
Description:
version:
Author: chenhao
Date: 2021-06-09 14:17:37
'''
import copy
import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class LayerNorm(nn.Module):
"Construct a layernorm module (See citation for details)."
def __init__(self, features, eps=1e-6)... | python | MIT | e8975264b0802f1fca4ebbc96f30a03ec2717311 | 2026-01-05T07:09:25.748166Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/constants.py | src/opentelemetry_mcp/constants.py | """
Semantic conventions for OpenTelemetry attributes.
This module centralizes all OpenTelemetry semantic convention constants used throughout
the codebase. It imports from:
- opentelemetry.semconv_ai: Traceloop and LLM-specific conventions (OpenLLMetry)
- opentelemetry.semconv.trace: Standard OpenTelemetry convention... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/models.py | src/opentelemetry_mcp/models.py | """Data models for OpenTelemetry traces and Opentelemetry conventions."""
from collections.abc import Sequence
from datetime import datetime
from enum import Enum
from typing import Literal
from pydantic import BaseModel, Field, model_validator
from .attributes import SpanAttributes, SpanEvent
from .constants import... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/utils.py | src/opentelemetry_mcp/utils.py | """Shared utility functions."""
from datetime import datetime
def parse_iso_timestamp(
timestamp_str: str | None, param_name: str
) -> tuple[datetime | None, str | None]:
"""Parse ISO 8601 timestamp string.
Args:
timestamp_str: ISO 8601 timestamp string (e.g., "2024-01-01T00:00:00Z")
par... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/config.py | src/opentelemetry_mcp/config.py | """Configuration management for Opentelemetry MCP Server."""
import logging
import os
from typing import Literal
from dotenv import load_dotenv
from pydantic import BaseModel, Field, HttpUrl, TypeAdapter, field_validator
logger = logging.getLogger(__name__)
# Load environment variables
load_dotenv()
class Backend... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/__init__.py | src/opentelemetry_mcp/__init__.py | """OpenTelemetry MCP Server - Query OpenTelemetry traces from LLM applications."""
__version__ = "0.2.0"
| python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/attributes.py | src/opentelemetry_mcp/attributes.py | """Strongly-typed span attribute models following OpenTelemetry semantic conventions."""
from typing import Literal
from pydantic import BaseModel, ConfigDict, Field
# Note: We import constants for documentation but must use string literals for Pydantic aliases
# due to mypy strict mode requirements
from .constants ... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/server.py | src/opentelemetry_mcp/server.py | """Opentelemetry MCP Server - Main entry point."""
import json
import logging
import sys
from typing import Any
import click
from fastmcp import FastMCP
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.backends.jaeger import JaegerBackend
from opentelemetry_mcp.backends.tempo import Tem... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/search.py | src/opentelemetry_mcp/tools/search.py | """Search traces tool implementation."""
import json
from typing import Any
from pydantic import ValidationError
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import Filter, TraceQuery, TraceSummary
from opentelemetry_mcp.utils import parse_iso_timestamp
async def search_tra... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/list_models.py | src/opentelemetry_mcp/tools/list_models.py | """List LLM models tool implementation."""
import json
from typing import Any
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes, TraceQuery
from opentelemetry_mcp.utils import parse_iso_timestamp
async def list_models(
backend: BaseBackend,
start_... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/search_spans.py | src/opentelemetry_mcp/tools/search_spans.py | """Search spans tool implementation."""
import json
from typing import Any
from pydantic import ValidationError
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import Filter, SpanQuery, SpanSummary
from opentelemetry_mcp.utils import parse_iso_timestamp
async def search_spans(... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/usage.py | src/opentelemetry_mcp/tools/usage.py | """LLM usage metrics tool implementation."""
import json
from typing import Any
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes, TraceQuery, UsageMetrics
from opentelemetry_mcp.utils import parse_iso_timestamp
async def get_llm_usage(
backend: BaseB... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/services.py | src/opentelemetry_mcp/tools/services.py | """List services and operations tool implementation."""
import json
from opentelemetry_mcp.backends.base import BaseBackend
async def list_services(backend: BaseBackend) -> str:
"""List all available services in the backend.
Args:
backend: Backend instance to query
Returns:
JSON string... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/trace.py | src/opentelemetry_mcp/tools/trace.py | """Get trace tool implementation."""
import json
from typing import Any
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes
async def get_trace(backend: BaseBackend, trace_id: str) -> str:
"""Get complete trace details by trace ID.
Args:
ba... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/list_llm_tools.py | src/opentelemetry_mcp/tools/list_llm_tools.py | """List LLM tools tool implementation."""
import json
from datetime import datetime
from typing import Any
from opentelemetry.semconv_ai import TraceloopSpanKindValues
from pydantic import BaseModel
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.constants import Traceloop
from opentel... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/errors.py | src/opentelemetry_mcp/tools/errors.py | """Find error traces tool implementation."""
import json
from typing import Any
from pydantic import ValidationError
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import TraceQuery, TraceSummary
from opentelemetry_mcp.utils import parse_iso_timestamp
async def find_errors(
... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/__init__.py | src/opentelemetry_mcp/tools/__init__.py | """MCP tools for querying OpenTelemetry traces."""
__all__ = []
| python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/expensive_traces.py | src/opentelemetry_mcp/tools/expensive_traces.py | """Expensive traces tool implementation."""
import json
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes, TraceQuery
from opentelemetry_mcp.utils import parse_iso_timestamp
async def get_expensive_traces(
backend: BaseBackend,
limit: int = 10,
... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/slow_traces.py | src/opentelemetry_mcp/tools/slow_traces.py | """Slow traces tool implementation."""
import json
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes, TraceQuery
from opentelemetry_mcp.utils import parse_iso_timestamp
async def get_slow_traces(
backend: BaseBackend,
limit: int = 10,
start_ti... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/tools/model_stats.py | src/opentelemetry_mcp/tools/model_stats.py | """Model statistics tool implementation."""
import json
from collections.abc import Sequence
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.models import LLMSpanAttributes, TraceQuery
from opentelemetry_mcp.utils import parse_iso_timestamp
def calculate_percentiles(values: Sequence[f... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/jaeger.py | src/opentelemetry_mcp/backends/jaeger.py | """Jaeger backend implementation for querying OpenTelemetry traces."""
import logging
from datetime import datetime
from typing import Any
from opentelemetry_mcp.attributes import HealthCheckResponse, SpanAttributes, SpanEvent
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.backends.fil... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/tempo.py | src/opentelemetry_mcp/backends/tempo.py | """Grafana Tempo backend implementation with TraceQL support."""
import logging
from datetime import datetime
from typing import Any, Literal
from opentelemetry_mcp.attributes import HealthCheckResponse, SpanAttributes, SpanEvent
from opentelemetry_mcp.backends.base import BaseBackend
from opentelemetry_mcp.backends.... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/traceloop.py | src/opentelemetry_mcp/backends/traceloop.py | """Traceloop backend implementation for querying Opentelemetry traces."""
import logging
from datetime import datetime, timedelta
from typing import Any, Literal
from opentelemetry_mcp.attributes import HealthCheckResponse, SpanAttributes, SpanEvent
from opentelemetry_mcp.backends.base import BaseBackend
from opentel... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/__init__.py | src/opentelemetry_mcp/backends/__init__.py | """Backend implementations for different OpenTelemetry trace storage systems."""
from opentelemetry_mcp.backends.base import BaseBackend
__all__ = ["BaseBackend"]
| python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/filter_engine.py | src/opentelemetry_mcp/backends/filter_engine.py | """Client-side filter engine for post-query filtering of traces and spans."""
import logging
from typing import Any, TypeVar, overload
from opentelemetry_mcp.models import Filter, FilterOperator, FilterType, SpanData, TraceData
logger = logging.getLogger(__name__)
T = TypeVar("T", TraceData, SpanData)
class Filte... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/src/opentelemetry_mcp/backends/base.py | src/opentelemetry_mcp/backends/base.py | """Abstract base backend for OpenTelemetry trace storage systems."""
from abc import ABC, abstractmethod
from typing import Any
import httpx
from opentelemetry_mcp.attributes import HealthCheckResponse
from opentelemetry_mcp.models import FilterOperator, SpanData, SpanQuery, TraceData, TraceQuery
class BaseBackend... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/test_models.py | tests/test_models.py | """Tests for data models."""
from datetime import datetime
from opentelemetry_mcp.attributes import SpanAttributes
from opentelemetry_mcp.models import LLMSpanAttributes, SpanData, TraceData, TraceQuery
def test_span_data_is_llm_span() -> None:
"""Test LLM span detection."""
# LLM span
llm_span = SpanDa... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/conftest.py | tests/conftest.py | """Pytest configuration and fixtures."""
from typing import Any
import pytest
from pydantic import HttpUrl
from opentelemetry_mcp.attributes import SpanAttributes
from opentelemetry_mcp.config import BackendConfig
from opentelemetry_mcp.models import SpanData, TraceData
@pytest.fixture
def sample_span_data() -> di... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/__init__.py | tests/__init__.py | """Tests for Opentelemetry MCP Server."""
| python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/test_traceloop.py | tests/test_traceloop.py | """Tests for Traceloop backend."""
from datetime import datetime
import pytest
from opentelemetry_mcp.backends.traceloop import TraceloopBackend
from opentelemetry_mcp.models import TraceQuery
def test_traceloop_backend_requires_api_key() -> None:
"""Test that Traceloop backend requires an API key."""
with... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/integration/conftest.py | tests/integration/conftest.py | """Fixtures and configuration for integration tests with VCR recordings."""
import json
import os
from collections.abc import AsyncGenerator
from typing import Any
from urllib.parse import parse_qs, urlparse
import pytest
from pydantic import HttpUrl, TypeAdapter
from vcr.request import Request
from opentelemetry_mc... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/integration/__init__.py | tests/integration/__init__.py | """Integration tests using VCR recordings against real backends."""
| python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/integration/test_jaeger_integration.py | tests/integration/test_jaeger_integration.py | """Integration tests for Jaeger backend using VCR recordings."""
import pytest
from opentelemetry_mcp.backends.jaeger import JaegerBackend
from opentelemetry_mcp.models import Filter, FilterOperator, FilterType, SpanQuery, TraceQuery
# Mark all tests in this module as integration and vcr
pytestmark = [pytest.mark.in... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/integration/test_traceloop_integration.py | tests/integration/test_traceloop_integration.py | """Integration tests for Traceloop backend with VCR cassette recordings.
These tests use pytest-recording to record HTTP responses from a real Traceloop
API instance and replay them in future test runs without requiring the live backend.
To record new cassettes:
export TRACELOOP_API_KEY="your_api_key"
uv run ... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
traceloop/opentelemetry-mcp-server | https://github.com/traceloop/opentelemetry-mcp-server/blob/541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799/tests/integration/test_tempo_integration.py | tests/integration/test_tempo_integration.py | """Integration tests for Tempo backend using VCR recordings."""
import pytest
from opentelemetry_mcp.backends.tempo import TempoBackend
from opentelemetry_mcp.models import Filter, FilterOperator, FilterType, SpanQuery, TraceQuery
# Mark all tests in this module as integration and vcr
pytestmark = [pytest.mark.integ... | python | Apache-2.0 | 541cf3ea19a19bcfd64a3dbd3cba5c41e48d3799 | 2026-01-05T07:09:27.035585Z | false |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/SD_rebasin_merge.py | SD_rebasin_merge.py | import argparse
import torch
import os
from tqdm import tqdm
from pathlib import Path
from safetensors.torch import load_file, save_file
from weight_matching import weight_matching, apply_permutation
from merge_PermSpec_SDXL import sdxl_permutation_spec
from merge_PermSpec_SD2 import sd2_permutation_spec
from merge_Pe... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | false |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/weight_matching.py | weight_matching.py | import torch
from scipy.optimize import linear_sum_assignment
import time
import random
from merge_PermSpec_ResNet import mlp_permutation_spec
from PermSpec_Base import PermutationSpec
from tqdm import tqdm
def get_permuted_param(ps: PermutationSpec, perm, k: str, params, except_axis=None):
"""Get parameter `k` from... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | false |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/merge_PermSpec_SD1UNet.py | merge_PermSpec_SD1UNet.py | from PermSpec_Base import PermutationSpec, permutation_spec_from_axes_to_perm
# Comment from DammK: This is the complete spec. It is not the UNET only! CLIP / VAE / UNET all are requried!
def sdunet_permutation_spec() -> PermutationSpec:
conv = lambda name, p_in, p_out: {f"{name}.weight": (p_out, p_in,), f"{name}.b... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | true |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/merge_PermSpec_SD2.py | merge_PermSpec_SD2.py | from PermSpec_Base import PermutationSpec, permutation_spec_from_axes_to_perm
def sd2_permutation_spec() -> PermutationSpec:
conv = lambda name, p_in, p_out: { # pylint: disable=unnecessary-lambda-assignment
f"{name}.weight": (
p_out,
p_in,
),
f"{name}.bias": (p_out... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | true |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/merge_PermSpec_SDXL.py | merge_PermSpec_SDXL.py | # Ref: https://github.com/vladmandic/automatic/blob/dev/modules/merging/merge_PermSpec_SDXL.py
# Diff: https://www.diffchecker.com/WZKq6YiP/
# Tldr: Awful. So many layers are incorrect and missing!
from PermSpec_Base import PermutationSpec, permutation_spec_from_axes_to_perm
def sdxl_permutation_spec() -> Permutation... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | true |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/merge_PermSpec_ResNet.py | merge_PermSpec_ResNet.py | from PermSpec_Base import PermutationSpec, permutation_spec_from_axes_to_perm
def mlp_permutation_spec(num_hidden_layers: int) -> PermutationSpec:
"""We assume that one permutation cannot appear in two axes of the same weight array."""
assert num_hidden_layers >= 1
return permutation_spec_from_axes_to_perm({
... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | false |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/PermSpec_Base.py | PermSpec_Base.py | from typing import NamedTuple
from collections import defaultdict
from re import L
class PermutationSpec(NamedTuple):
perm_to_axes: dict
axes_to_perm: dict
def permutation_spec_from_axes_to_perm(axes_to_perm: dict) -> PermutationSpec:
perm_to_axes = defaultdict(list)
for wk, axis_perms in axes_to_perm.items()... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | false |
ogkalu2/Merge-Stable-Diffusion-models-without-distortion | https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion/blob/a109cd9578debe5be0de9325583dda8b0d534096/prune.py | prune.py | import os
import torch
from easygui import fileopenbox, enterbox, diropenbox
def prune_it(p, keep_only_ema=False):
print(f"prunin' in path: {p}")
size_initial = os.path.getsize(p)
nsd = dict()
sd = torch.load(p, map_location="cpu")
print(sd.keys())
for k in sd.keys():
if k != "optimizer... | python | MIT | a109cd9578debe5be0de9325583dda8b0d534096 | 2026-01-05T07:09:28.429625Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/manage.py | manage.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dolweb.settings")
try:
from django.core.management import execute_from_command_line
excep... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/fabfile.py | fabfile.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from fabric import task
_HOSTS = ["dolphin-emu@ssh-dolphin-emu.alwaysdata.net"]
def deploy(c, root, branch):
activate = "source /home/dolphin-emu/venv/www/bin/activate"
with c.cd(root):
c.run("git fetch")
... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/settings.py | dolweb/settings.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
# Django settings for dolweb project.
# -*- encoding: utf-8 -*-
import os.path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SERVE_MEDIA = DEBUG
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
P... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/__init__.py | dolweb/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/wsgi.py | dolweb/wsgi.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
"""
WSGI config for dolweb project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``ru... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/urls.py | dolweb/urls.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.storage import staticfiles_storage
from django... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/management/views.py | dolweb/management/views.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.http import Http404, HttpResponse
import base64
import subprocess
def make_401_response():
response = HttpResponse()
response.status_code = 401
response['WWW-Authenticate... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/management/__init__.py | dolweb/management/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/views.py | dolweb/compat/views.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from annoying.decorators import render_to
from django.views.decorators.cache import cache_page
from dolweb.compat.models import Page, Namespace, get_category_id, \
CategoryLink
import hashlib
imp... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/admin.py | dolweb/compat/admin.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.contrib import admin
from dolweb.compat.models import Page
class PageAdmin(admin.ModelAdmin):
list_display = ('title', 'namespace')
ordering = ('namespace', 'title_url')
admin.site.register(Page, PageAdmin)
| python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/models.py | dolweb/compat/models.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from datetime import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import models
import urllib.parse
class Namespace(object):
MAIN = 0
TALK = 1
USER = 2
USER_TALK =... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/__init__.py | dolweb/compat/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/urls.py | dolweb/compat/urls.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf.urls import url
from dolweb.compat.views import list_compat
urlpatterns = [
url(r'^$', list_compat, name='compat_index'),
url(r'^(?:(?P<first_char>[A-Z#])/)?(?:filter/(?P<filter_by>[12345])/)?$', list_co... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/templatetags/compat.py | dolweb/compat/templatetags/compat.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django import template
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from dolweb.c... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/templatetags/__init__.py | dolweb/compat/templatetags/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/management/__init__.py | dolweb/compat/management/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/management/commands/genatlas.py | dolweb/compat/management/commands/genatlas.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from dolweb.compat.models import Page
from PIL import Image
from io import BytesIO
import binascii
import collections
import hash... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/management/commands/__init__.py | dolweb/compat/management/commands/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/migrations/0001_initial.py | dolweb/compat/migrations/0001_initial.py | # Generated by Django 2.0.7 on 2018-07-21 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/compat/migrations/__init__.py | dolweb/compat/migrations/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/monkey.py | dolweb/utils/monkey.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.utils.translation.trans_real import *
from django.utils.translation import trans_real
TO_FULL = {
'br': 'pt-BR',
'cn': 'zh-CN',
'ms': 'ms-MY',
}
TO_FULL_INVERTED = {v.lower(): k for k, v in TO_FULL.items(... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/db.py | dolweb/utils/db.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
class WikiRouter(object):
"""
Routes access to wiki/compat models to the wiki database, and everything
else to the default database.
"""
def db_for_read(self, model, **hints)... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/models_utils.py | dolweb/utils/models_utils.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.db import models
class DefaultSelectOrPrefetchManager(models.Manager):
def __init__(self, *args, **kwargs):
self._select_related = kwargs.pop('select_related', None)
self._prefetch_related = kwarg... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/context_processors.py | dolweb/utils/context_processors.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
def website_urls(request):
return {
"DISCORD_URL": settings.DISCORD_URL,
"FORUM_URL": settings.FORUM_URL,
"WIKI_URL": settings.WIKI_URL,
"GIT_BROWSE_URL": sett... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/__init__.py | dolweb/utils/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/cache.py | dolweb/utils/cache.py | # Copyright (c) 2019 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.views.decorators.cache import patch_cache_control
from django.utils.cache import patch_response_headers
class DefaultCacheControlMiddleware:
"""Used to set a default Cache-Control header."""
def __init__(sel... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/dyni18n.py | dolweb/utils/dyni18n.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.utils.translation import get_language
import glob
import os.path
import polib
import time
UPDATE_EVERY = 300
_DOMAINS = {}
class DynI18NDomain(object):
def __init__(self, name)... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/utils/country_redirect.py | dolweb/utils/country_redirect.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.translation.trans_real import parse_accept_lang_header
from dolweb.utils.monkey import TO_FULL_INVERTED
import datetime
def guess_... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/views.py | dolweb/downloads/views.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from annoying.decorators import render_to
from django.conf import settings
from django.core.paginator import EmptyPage
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404, ge... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/admin.py | dolweb/downloads/admin.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.contrib import admin
from dolweb.downloads.models import Artifact, BranchInfo, ReleaseVersion, DevVersion
class BranchInfoAdmin(admin.ModelAdmin):
list_display = ('name', 'visible')
ordering = ('-visible', 'n... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/models.py | dolweb/downloads/models.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from dolweb.utils import models_utils
... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/diggpaginator.py | dolweb/downloads/diggpaginator.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
import functools
import math
from django.core.paginator import \
Paginator, QuerySetPaginator, Page, InvalidPage
__all__ = (
'InvalidPage',
'ExPaginator',
'DiggPaginator',
'QuerySetDiggPaginator',
)
class Ex... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/__init__.py | dolweb/downloads/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/urls.py | dolweb/downloads/urls.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django.conf.urls import url
from dolweb.downloads import views
urlpatterns = [
url(r'^$', views.index, name='downloads_index'),
url(r'^branches/$', views.branches, name='downloads_branches'),
url(r'^new/$', view... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/templatetags/artifacts.py | dolweb/downloads/templatetags/artifacts.py | # Copyright (c) 2018 Dolphin Emulator Website Contributors
# SPDX-License-Identifier: MIT
from django import template
register = template.Library()
@register.filter
def artifact_sort(artifacts):
"""Sorts an iterable of artifacts by target system."""
matchers = (
('Windows', 0x8000),
('macOS',... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/templatetags/__init__.py | dolweb/downloads/templatetags/__init__.py | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false | |
dolphin-emu/www | https://github.com/dolphin-emu/www/blob/c8b0f64e3ecb4607b86c1712e6828809f3e5a02b/dolweb/downloads/migrations/0002_dlv_move_from_dev.py | dolweb/downloads/migrations/0002_dlv_move_from_dev.py | from django.db import migrations, models
def transfer_dev_to_dlv(apps, schema_editor):
DevVersion = apps.get_model('downloads', 'DevVersion')
for dev in DevVersion.objects.all():
dev.description_dlv = dev.description
dev.hash_dlv = dev.hash
dev.shortrev_dlv = dev.shortrev
dev.sa... | python | MIT | c8b0f64e3ecb4607b86c1712e6828809f3e5a02b | 2026-01-05T07:09:32.243100Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.